#line 1 "..\\config\\Drv_Config_NWJ.c"





 








































































































 
















































































































































































































































































































































































































 
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































 






















































































































































































































































































































































































































 











































































































































































































































































































 





























































































































































































































































































































































































































































































































 











































































































































































 





































































































































































































 





















 

















 























































































































 












































































































 





















unsigned char ucUART_DEBUG_ID = 0;









































typedef const struct 
{
	unsigned short xPort : 3,						   
			xPin  : 4,					   
			xMode : 8,					   
			xSta  : 1;					   
	unsigned char xSpeed;
}t_iomap;



 
const unsigned char IO_NUM = 16;	


t_iomap IOMap[16]=
{

	6,8,	0x10, 1,3,


	2,6,	0x10, 1,3,


	2,8,	0x48, 0,3,


	1,7,	0x48, 0,3,


	6,13,	0x48, 1,3,


	1,12,	0x48, 1,3,


	5,11,	0x48, 0,3,


	2,4,	0x48, 0,3,


	6,11,	0x10, 1,3,


	6,14,	0x10, 1,3,


	2,0, 0x10,	1,3,


	0,1, 0x10,	1,3,


	0,0, 0x10,	1,3,


	2,7, 0x10,	0,3,


	5,6, 0x10,	1,1,


	5,9, 0x48,	1,1,
#line 3671 "..\\config\\Drv_Config_NWJ.c"
	};



 
const unsigned char KEY_NUM = 6;

t_iomap KEYMap[6]=
{

	0,11, 0x48,	1,2,


	0,12, 0x48,	1,2,


	6,15, 0x48,	1,2,


	3,3, 0x48,	1,2,


	0,8, 0x48,	1,2,


	2,9, 0x48,	1,2,
#line 3710 "..\\config\\Drv_Config_NWJ.c"
};



 
const unsigned char I2C_NUM = 1;

t_iomap I2CMap[1][2]=
{

	{1, 8,	0x14,	1,2, 	
	 1, 9,	0x14,	1,2,}	
















};




 
const unsigned short ADC_DMA_BUF = 108;
const unsigned char ADC_RCC_DIV = 8;
const unsigned char ADC_NUM = 9;
const unsigned char ADC_SampleTime_Cycles = 0x2;
const unsigned char ADC_CCMode = 1;
const unsigned char ADC1_CHANNEL[9]=
{

	0xD,


	0x0A,


	0x03,


	0x0D,


	0x0B,


	0x06,


	0x0D,


	0x0C,


	0x07,






};

volatile unsigned short AD_Value_buf[108];						

t_iomap ADCMap[9]=
{

	2,3, 0,	0,0,


	2,0, 0,	0,0,


	0,3, 0,	0,0,


	2,3, 0,	0,0,


	2,1, 0,	0,0,


	0,6, 0,	0,0,


	2,3, 0,	0,0,


	2,2, 0,	0,0,


	0,7, 0,	0,0,




		
};



 	
const unsigned char port_dm_irq = 6;
const unsigned char pin_dm_irq = 7;
const unsigned char port_dm_reset = 6;
const unsigned char pin_dm_reset = 6;
const unsigned int DM9000_BASE_ADR = 0x68000000;
const unsigned int DM9000_CMD_ADR = 0x68200000;
const unsigned int DM9000_DATA_ADR = 0x69200000;
const unsigned char DM9000_BUS_WIDTH = 16;
   
t_iomap DM9000Map[2]=
{
	6,	6,	0x10,	1,2,
	6,	7, 	0x04,	1,2,
};
		


 
const unsigned int NORFLASH_BASE_ADR = 0x60000000;



 
const unsigned int NAND_BASE_ADR = 0x80000000;




 
const unsigned int GUI_LCD_BASE_ADR = 0x6C000000;






#line 3874 "..\\config\\Drv_Config_NWJ.c"
	unsigned char gui_aBuf[160][(160/8)+1];



t_iomap LCDMap[2]=
{
	1, 6,	0x10, 1,2,		
	1,	5, 	0x10,	0,3,			
};



 
const unsigned char VK321X_IRQPORT = 6;
const unsigned char VK321X_IRQPIN = 13;
const unsigned char VK321X_UARTID = 3;

t_iomap VK321XMap[2]=
{
	1,	7,	0x10,	1,2, 	 
	6,	13, 	0x48,	0,2,		
};



 
t_iomap MODEMMap[4]=
{
	1, 1,	0x10, 0,2, 
	1, 0,	0x10, 0,2, 
	2, 2,	0x10, 0,2, 
	2, 5,	0x04, 0,2, 




};



 
const unsigned char PPPSER_COM = 1;
const unsigned int PPPSER_BAUD = 115200;
const unsigned char PPPSER_DATABIT = 8;	  
const unsigned char PPPSER_STOPBIT = 1;
const unsigned char PPPSER_PARITY = 0;   
const unsigned int PPPSER_RXBUF = 255;
const unsigned int PPPSER_TXBUF = 255;
const unsigned char DEBUG_PPPAT = 0;



 
const unsigned char I2C_CH_TIME = 0;




 
const unsigned int BOOTLOADER_SIZE = 0x2000;
const unsigned int STM32_BASEADR = 0x08000000;


 
const unsigned int STM32_EXT_SRAM_BEGIN =0x68000000;



 
const unsigned char IWDG_XPRES = 4;
const unsigned short IWDG_XSETR = 3800;



 
const unsigned char SPI_NUM = 2;

t_iomap SPIMap[2][4]=
{

	{0, 5,	0x18, 0,2,	
	 0, 7,	0x18,	0,2, 	
	 0, 6,	0x18,	0,2,	
	 0, 4, 0x10, 1,2,},		



	{5, 8,	0x14, 1,2,	
	 5, 10,	0x14,	1,2, 	
	 5, 9,	0x14,	1,2,	
	 5, 6, 0x14, 1,2,},		


#line 3973 "..\\config\\Drv_Config_NWJ.c"
};



 
t_iomap ATT7022Map[3]=
{
	5,	6,	0x14,	1, 2,	 
	2,	14,	0x48,	0, 	2, 	 
	0,	4,		0x14,	1, 2,		 
};

#line 1 "..\\config\\Retarget.c"

#line 1 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
 
 
 
 




 








 












#line 38 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"


  



    typedef unsigned int size_t;    
#line 54 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"




extern __declspec(__nothrow) void *memcpy(void * __restrict  ,
                    const void * __restrict  , size_t  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) void *memmove(void *  ,
                    const void *  , size_t  ) __attribute__((__nonnull__(1,2)));
   







 
extern __declspec(__nothrow) char *strcpy(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) char *strncpy(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(1,2)));
   





 

extern __declspec(__nothrow) char *strcat(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) char *strncat(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(1,2)));
   






 






 

extern __declspec(__nothrow) int memcmp(const void *  , const void *  , size_t  ) __attribute__((__nonnull__(1,2)));
   





 
extern __declspec(__nothrow) int strcmp(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) int strncmp(const char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   






 
extern __declspec(__nothrow) int strcasecmp(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   





 
extern __declspec(__nothrow) int strncasecmp(const char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   






 
extern __declspec(__nothrow) int strcoll(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   







 

extern __declspec(__nothrow) size_t strxfrm(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(2)));
   













 


#line 193 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) void *memchr(const void *  , int  , size_t  ) __attribute__((__nonnull__(1)));

   





 

#line 209 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strchr(const char *  , int  ) __attribute__((__nonnull__(1)));

   




 

extern __declspec(__nothrow) size_t strcspn(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   




 

#line 232 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strpbrk(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));

   




 

#line 247 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strrchr(const char *  , int  ) __attribute__((__nonnull__(1)));

   





 

extern __declspec(__nothrow) size_t strspn(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   



 

#line 270 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strstr(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));

   





 

extern __declspec(__nothrow) char *strtok(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(2)));
extern __declspec(__nothrow) char *_strtok_r(char *  , const char *  , char **  ) __attribute__((__nonnull__(2,3)));

extern __declspec(__nothrow) char *strtok_r(char *  , const char *  , char **  ) __attribute__((__nonnull__(2,3)));

   

































 

extern __declspec(__nothrow) void *memset(void *  , int  , size_t  ) __attribute__((__nonnull__(1)));
   



 
extern __declspec(__nothrow) char *strerror(int  );
   





 
extern __declspec(__nothrow) size_t strlen(const char *  ) __attribute__((__nonnull__(1)));
   



 

extern __declspec(__nothrow) size_t strlcpy(char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   
















 

extern __declspec(__nothrow) size_t strlcat(char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   






















 

extern __declspec(__nothrow) void _membitcpybl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpybb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpyhl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpyhb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpywl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpywb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovebl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovebb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovehl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovehb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovewl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovewb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
    














































 







#line 502 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"



 

#line 3 "..\\config\\Retarget.c"
#line 1 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\time.h"
 
 
 
 









 





 













#line 41 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\time.h"


  



    typedef unsigned int size_t;    
#line 57 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\time.h"




    
 
#line 73 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\time.h"





typedef unsigned int clock_t;     
typedef unsigned int time_t;      

#pragma push
#pragma anon_unions

struct tm {
    int tm_sec;   
 
    int tm_min;    
    int tm_hour;   
    int tm_mday;   
    int tm_mon;    
    int tm_year;   
    int tm_wday;   
    int tm_yday;   
    int tm_isdst;  
    union {        
        struct {
            int __extra_1, __extra_2;
        };
        struct {
            long __extra_1_long, __extra_2_long;
        };
        struct {
            char *__extra_1_cptr, *__extra_2_cptr;
        };
        struct {
            void *__extra_1_vptr, *__extra_2_vptr;
        };
    };
};

#pragma pop

   



 

extern __declspec(__nothrow) clock_t clock(void);
   





 
extern __declspec(__nothrow) double difftime(time_t  , time_t  );
   


 
extern __declspec(__nothrow) time_t mktime(struct tm *  ) __attribute__((__nonnull__(1)));
   













 
extern __declspec(__nothrow) time_t time(time_t *  );
   






 

extern __declspec(__nothrow) char *asctime(const struct tm *  ) __attribute__((__nonnull__(1)));
extern __declspec(__nothrow) char *_asctime_r(const struct tm *  ,
                                char * __restrict  ) __attribute__((__nonnull__(1,2)));

extern __declspec(__nothrow) char *asctime_r(const struct tm *  ,
                               char * __restrict  ) __attribute__((__nonnull__(1,2)));

   



 
extern __declspec(__nothrow) char *ctime(const time_t *  ) __attribute__((__nonnull__(1)));
   




 
extern __declspec(__nothrow) struct tm *gmtime(const time_t *  ) __attribute__((__nonnull__(1)));
   



 
extern __declspec(__nothrow) struct tm *localtime(const time_t *  ) __attribute__((__nonnull__(1)));
extern __declspec(__nothrow) struct tm *_localtime_r(const time_t * __restrict  ,
                                       struct tm * __restrict  ) __attribute__((__nonnull__(1,2)));

extern __declspec(__nothrow) struct tm *localtime_r(const time_t * __restrict  ,
                                      struct tm * __restrict  ) __attribute__((__nonnull__(1,2)));

   



 
extern __declspec(__nothrow) size_t strftime(char * __restrict  , size_t  ,
                       const char * __restrict  ,
                       const struct tm * __restrict  ) __attribute__((__nonnull__(1,3,4)));
   











































 











#line 280 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\time.h"



 

#line 4 "..\\config\\Retarget.c"
#line 1 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"
 
 
 





 










#line 27 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"








 

 
 
#line 57 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"
    typedef struct __va_list { void *__ap; } va_list;

   






 


   










 


   















 




   

 


   




 



   





 







#line 138 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"



#line 147 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"

 

#line 5 "..\\config\\Retarget.c"
#line 1 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"
 
 
 




 
 



 






   














  


 








#line 54 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"


  



    typedef unsigned int size_t;    
#line 70 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"






    



    typedef unsigned short wchar_t;  
#line 91 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"

typedef struct div_t { int quot, rem; } div_t;
    
typedef struct ldiv_t { long int quot, rem; } ldiv_t;
    

typedef struct lldiv_t { long long quot, rem; } lldiv_t;
    


#line 112 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"
   



 

   




 
#line 131 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"
   


 
extern __declspec(__nothrow) int __aeabi_MB_CUR_MAX(void);

   




 

   




 




extern __declspec(__nothrow) double atof(const char *  ) __attribute__((__nonnull__(1)));
   



 
extern __declspec(__nothrow) int atoi(const char *  ) __attribute__((__nonnull__(1)));
   



 
extern __declspec(__nothrow) long int atol(const char *  ) __attribute__((__nonnull__(1)));
   



 

extern __declspec(__nothrow) long long atoll(const char *  ) __attribute__((__nonnull__(1)));
   



 


extern __declspec(__nothrow) double strtod(const char * __restrict  , char ** __restrict  ) __attribute__((__nonnull__(1)));
   

















 

extern __declspec(__nothrow) float strtof(const char * __restrict  , char ** __restrict  ) __attribute__((__nonnull__(1)));
extern __declspec(__nothrow) long double strtold(const char * __restrict  , char ** __restrict  ) __attribute__((__nonnull__(1)));
   

 

extern __declspec(__nothrow) long int strtol(const char * __restrict  ,
                        char ** __restrict  , int  ) __attribute__((__nonnull__(1)));
   



























 
extern __declspec(__nothrow) unsigned long int strtoul(const char * __restrict  ,
                                       char ** __restrict  , int  ) __attribute__((__nonnull__(1)));
   


























 

 
extern __declspec(__nothrow) long long strtoll(const char * __restrict  ,
                                  char ** __restrict  , int  )
                          __attribute__((__nonnull__(1)));
   




 
extern __declspec(__nothrow) unsigned long long strtoull(const char * __restrict  ,
                                            char ** __restrict  , int  )
                                   __attribute__((__nonnull__(1)));
   



 

extern __declspec(__nothrow) int rand(void);
   







 
extern __declspec(__nothrow) void srand(unsigned int  );
   






 

struct _rand_state { int __x[57]; };
extern __declspec(__nothrow) int _rand_r(struct _rand_state *);
extern __declspec(__nothrow) void _srand_r(struct _rand_state *, unsigned int);
struct _ANSI_rand_state { int __x[1]; };
extern __declspec(__nothrow) int _ANSI_rand_r(struct _ANSI_rand_state *);
extern __declspec(__nothrow) void _ANSI_srand_r(struct _ANSI_rand_state *, unsigned int);
   


 

extern __declspec(__nothrow) void *calloc(size_t  , size_t  );
   



 
extern __declspec(__nothrow) void free(void *  );
   





 
extern __declspec(__nothrow) void *malloc(size_t  );
   



 
extern __declspec(__nothrow) void *realloc(void *  , size_t  );
   













 

extern __declspec(__nothrow) int posix_memalign(void **  , size_t  , size_t  );
   









 

typedef int (*__heapprt)(void *, char const *, ...);
extern __declspec(__nothrow) void __heapstats(int (*  )(void *  ,
                                           char const *  , ...),
                        void *  ) __attribute__((__nonnull__(1)));
   










 
extern __declspec(__nothrow) int __heapvalid(int (*  )(void *  ,
                                           char const *  , ...),
                       void *  , int  ) __attribute__((__nonnull__(1)));
   














 
extern __declspec(__nothrow) __declspec(__noreturn) void abort(void);
   







 

extern __declspec(__nothrow) int atexit(void (*  )(void)) __attribute__((__nonnull__(1)));
   




 
#line 436 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"


extern __declspec(__nothrow) __declspec(__noreturn) void exit(int  );
   












 

extern __declspec(__nothrow) __declspec(__noreturn) void _Exit(int  );
   







      

extern __declspec(__nothrow) char *getenv(const char *  ) __attribute__((__nonnull__(1)));
   









 

extern __declspec(__nothrow) int  system(const char *  );
   









 

extern  void *bsearch(const void *  , const void *  ,
              size_t  , size_t  ,
              int (*  )(const void *, const void *)) __attribute__((__nonnull__(1,2,5)));
   












 
#line 524 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"


extern  void qsort(void *  , size_t  , size_t  ,
           int (*  )(const void *, const void *)) __attribute__((__nonnull__(1,4)));
   









 

#line 553 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"

extern __declspec(__nothrow) __attribute__((const)) int abs(int  );
   



 

extern __declspec(__nothrow) __attribute__((const)) div_t div(int  , int  );
   









 
extern __declspec(__nothrow) __attribute__((const)) long int labs(long int  );
   



 




extern __declspec(__nothrow) __attribute__((const)) ldiv_t ldiv(long int  , long int  );
   











 







extern __declspec(__nothrow) __attribute__((const)) long long llabs(long long  );
   



 




extern __declspec(__nothrow) __attribute__((const)) lldiv_t lldiv(long long  , long long  );
   











 
#line 634 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"




 
typedef struct __sdiv32by16 { int quot, rem; } __sdiv32by16;
typedef struct __udiv32by16 { unsigned int quot, rem; } __udiv32by16;
    
typedef struct __sdiv64by32 { int rem, quot; } __sdiv64by32;

__value_in_regs extern __declspec(__nothrow) __attribute__((const)) __sdiv32by16 __rt_sdiv32by16(
     int  ,
     short int  );
   

 
__value_in_regs extern __declspec(__nothrow) __attribute__((const)) __udiv32by16 __rt_udiv32by16(
     unsigned int  ,
     unsigned short  );
   

 
__value_in_regs extern __declspec(__nothrow) __attribute__((const)) __sdiv64by32 __rt_sdiv64by32(
     int  , unsigned int  ,
     int  );
   

 




 
extern __declspec(__nothrow) unsigned int __fp_status(unsigned int  , unsigned int  );
   







 























 
extern __declspec(__nothrow) int mblen(const char *  , size_t  );
   












 
extern __declspec(__nothrow) int mbtowc(wchar_t * __restrict  ,
                   const char * __restrict  , size_t  );
   















 
extern __declspec(__nothrow) int wctomb(char *  , wchar_t  );
   













 





 
extern __declspec(__nothrow) size_t mbstowcs(wchar_t * __restrict  ,
                      const char * __restrict  , size_t  ) __attribute__((__nonnull__(2)));
   














 
extern __declspec(__nothrow) size_t wcstombs(char * __restrict  ,
                      const wchar_t * __restrict  , size_t  ) __attribute__((__nonnull__(2)));
   














 

extern __declspec(__nothrow) void __use_realtime_heap(void);
extern __declspec(__nothrow) void __use_realtime_division(void);
extern __declspec(__nothrow) void __use_two_region_memory(void);
extern __declspec(__nothrow) void __use_no_heap(void);
extern __declspec(__nothrow) void __use_no_heap_region(void);

extern __declspec(__nothrow) char const *__C_library_version_string(void);
extern __declspec(__nothrow) int __C_library_version_number(void);











#line 892 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdlib.h"





 
#line 6 "..\\config\\Retarget.c"

#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"














 

 



 
#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"














 

 







 
#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"













 

 



 
#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_type.h"














 

 



 
 
typedef signed long  s32;
typedef signed short s16;
typedef signed char  s8;

typedef signed long  const sc32;   
typedef signed short const sc16;   
typedef signed char  const sc8;    

typedef volatile signed long  vs32;
typedef volatile signed short vs16;
typedef volatile signed char  vs8;

typedef volatile signed long  const vsc32;   
typedef volatile signed short const vsc16;   
typedef volatile signed char  const vsc8;    

typedef unsigned long  u32;
typedef unsigned short u16;
typedef unsigned char  u8;

typedef unsigned long  const uc32;   
typedef unsigned short const uc16;   
typedef unsigned char  const uc8;    

typedef volatile unsigned long  vu32;
typedef volatile unsigned short vu16;
typedef volatile unsigned char  vu8;

typedef volatile unsigned long  const vuc32;   
typedef volatile unsigned short const vuc16;   
typedef volatile unsigned char  const vuc8;    



typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;

typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;


typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;

#line 73 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_type.h"

 
 
 



 
#line 22 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"

 
 


 
 

 
 





 


 


 


 


 


 
#line 66 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"

 


 



 


 


 
#line 90 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"

 




 


 


 


 


 


 


 





 


 
#line 133 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"

 
#line 141 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"

 



 


 
#line 167 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_conf.h"



 
#line 27 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"
#line 28 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"
#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\cortexm3_macro.h"













 

 



 
#line 22 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\cortexm3_macro.h"

 
 
 
 
void __WFI(void);
void __WFE(void);
void __SEV(void);
void __ISB(void);
void __DSB(void);
void __DMB(void);
void __SVC(void);
u32 __MRS_CONTROL(void);
void __MSR_CONTROL(u32 Control);
u32 __MRS_PSP(void);
void __MSR_PSP(u32 TopOfProcessStack);
u32 __MRS_MSP(void);
void __MSR_MSP(u32 TopOfMainStack);
void __RESETPRIMASK(void);
void __SETPRIMASK(void);
u32 __READ_PRIMASK(void);
void __RESETFAULTMASK(void);
void __SETFAULTMASK(void);
u32 __READ_FAULTMASK(void);
void __BASEPRICONFIG(u32 NewPriority);
u32 __GetBASEPRI(void);
u16 __REV_HalfWord(u16 Data);
u32 __REV_Word(u32 Data);



 
#line 29 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"

 
 
 
 

 
typedef struct
{
  vu32 SR;
  vu32 CR1;
  vu32 CR2;
  vu32 SMPR1;
  vu32 SMPR2;
  vu32 JOFR1;
  vu32 JOFR2;
  vu32 JOFR3;
  vu32 JOFR4;
  vu32 HTR;
  vu32 LTR;
  vu32 SQR1;
  vu32 SQR2;
  vu32 SQR3;
  vu32 JSQR;
  vu32 JDR1;
  vu32 JDR2;
  vu32 JDR3;
  vu32 JDR4;
  vu32 DR;
} ADC_TypeDef;

 
typedef struct
{
  u32  RESERVED0;
  vu16 DR1;
  u16  RESERVED1;
  vu16 DR2;
  u16  RESERVED2;
  vu16 DR3;
  u16  RESERVED3;
  vu16 DR4;
  u16  RESERVED4;
  vu16 DR5;
  u16  RESERVED5;
  vu16 DR6;
  u16  RESERVED6;
  vu16 DR7;
  u16  RESERVED7;
  vu16 DR8;
  u16  RESERVED8;
  vu16 DR9;
  u16  RESERVED9;
  vu16 DR10;
  u16  RESERVED10; 
  vu16 RTCCR;
  u16  RESERVED11;
  vu16 CR;
  u16  RESERVED12;
  vu16 CSR;
  u16  RESERVED13[5];
  vu16 DR11;
  u16  RESERVED14;
  vu16 DR12;
  u16  RESERVED15;
  vu16 DR13;
  u16  RESERVED16;
  vu16 DR14;
  u16  RESERVED17;
  vu16 DR15;
  u16  RESERVED18;
  vu16 DR16;
  u16  RESERVED19;
  vu16 DR17;
  u16  RESERVED20;
  vu16 DR18;
  u16  RESERVED21;
  vu16 DR19;
  u16  RESERVED22;
  vu16 DR20;
  u16  RESERVED23;
  vu16 DR21;
  u16  RESERVED24;
  vu16 DR22;
  u16  RESERVED25;
  vu16 DR23;
  u16  RESERVED26;
  vu16 DR24;
  u16  RESERVED27;
  vu16 DR25;
  u16  RESERVED28;
  vu16 DR26;
  u16  RESERVED29;
  vu16 DR27;
  u16  RESERVED30;
  vu16 DR28;
  u16  RESERVED31;
  vu16 DR29;
  u16  RESERVED32;
  vu16 DR30;
  u16  RESERVED33; 
  vu16 DR31;
  u16  RESERVED34;
  vu16 DR32;
  u16  RESERVED35;
  vu16 DR33;
  u16  RESERVED36;
  vu16 DR34;
  u16  RESERVED37;
  vu16 DR35;
  u16  RESERVED38;
  vu16 DR36;
  u16  RESERVED39;
  vu16 DR37;
  u16  RESERVED40;
  vu16 DR38;
  u16  RESERVED41;
  vu16 DR39;
  u16  RESERVED42;
  vu16 DR40;
  u16  RESERVED43;
  vu16 DR41;
  u16  RESERVED44;
  vu16 DR42;
  u16  RESERVED45;    
} BKP_TypeDef;

 
typedef struct
{
  vu32 TIR;
  vu32 TDTR;
  vu32 TDLR;
  vu32 TDHR;
} CAN_TxMailBox_TypeDef;

typedef struct
{
  vu32 RIR;
  vu32 RDTR;
  vu32 RDLR;
  vu32 RDHR;
} CAN_FIFOMailBox_TypeDef;

typedef struct
{
  vu32 FR1;
  vu32 FR2;
} CAN_FilterRegister_TypeDef;

typedef struct
{
  vu32 MCR;
  vu32 MSR;
  vu32 TSR;
  vu32 RF0R;
  vu32 RF1R;
  vu32 IER;
  vu32 ESR;
  vu32 BTR;
  u32  RESERVED0[88];
  CAN_TxMailBox_TypeDef sTxMailBox[3];
  CAN_FIFOMailBox_TypeDef sFIFOMailBox[2];
  u32  RESERVED1[12];
  vu32 FMR;
  vu32 FM1R;
  u32  RESERVED2;
  vu32 FS1R;
  u32  RESERVED3;
  vu32 FFA1R;
  u32  RESERVED4;
  vu32 FA1R;
  u32  RESERVED5[8];
  CAN_FilterRegister_TypeDef sFilterRegister[14];
} CAN_TypeDef;

 
typedef struct
{
  vu32 DR;
  vu8  IDR;
  u8   RESERVED0;
  u16  RESERVED1;
  vu32 CR;
} CRC_TypeDef;


 
typedef struct
{
  vu32 CR;
  vu32 SWTRIGR;
  vu32 DHR12R1;
  vu32 DHR12L1;
  vu32 DHR8R1;
  vu32 DHR12R2;
  vu32 DHR12L2;
  vu32 DHR8R2;
  vu32 DHR12RD;
  vu32 DHR12LD;
  vu32 DHR8RD;
  vu32 DOR1;
  vu32 DOR2;
} DAC_TypeDef;

 
typedef struct
{
  vu32 IDCODE;
  vu32 CR;	
}DBGMCU_TypeDef;

 
typedef struct
{
  vu32 CCR;
  vu32 CNDTR;
  vu32 CPAR;
  vu32 CMAR;
} DMA_Channel_TypeDef;

typedef struct
{
  vu32 ISR;
  vu32 IFCR;
} DMA_TypeDef;

 
typedef struct
{
  vu32 IMR;
  vu32 EMR;
  vu32 RTSR;
  vu32 FTSR;
  vu32 SWIER;
  vu32 PR;
} EXTI_TypeDef;

 
typedef struct
{
  vu32 ACR;
  vu32 KEYR;
  vu32 OPTKEYR;
  vu32 SR;
  vu32 CR;
  vu32 AR;
  vu32 RESERVED;
  vu32 OBR;
  vu32 WRPR;
} FLASH_TypeDef;

typedef struct
{
  vu16 RDP;
  vu16 USER;
  vu16 Data0;
  vu16 Data1;
  vu16 WRP0;
  vu16 WRP1;
  vu16 WRP2;
  vu16 WRP3;
} OB_TypeDef;

 
typedef struct
{
  vu32 BTCR[8];   
} FSMC_Bank1_TypeDef; 

typedef struct
{
  vu32 BWTR[7];
} FSMC_Bank1E_TypeDef;

typedef struct
{
  vu32 PCR2;
  vu32 SR2;
  vu32 PMEM2;
  vu32 PATT2;
  u32  RESERVED0;   
  vu32 ECCR2; 
} FSMC_Bank2_TypeDef;  

typedef struct
{
  vu32 PCR3;
  vu32 SR3;
  vu32 PMEM3;
  vu32 PATT3;
  u32  RESERVED0;   
  vu32 ECCR3; 
} FSMC_Bank3_TypeDef; 

typedef struct
{
  vu32 PCR4;
  vu32 SR4;
  vu32 PMEM4;
  vu32 PATT4;
  vu32 PIO4; 
} FSMC_Bank4_TypeDef; 

 
typedef struct
{
  vu32 CRL;
  vu32 CRH;
  vu32 IDR;
  vu32 ODR;
  vu32 BSRR;
  vu32 BRR;
  vu32 LCKR;
} GPIO_TypeDef;

typedef struct
{
  vu32 EVCR;
  vu32 MAPR;
  vu32 EXTICR[4];
} AFIO_TypeDef;

 
typedef struct
{
  vu16 CR1;
  u16  RESERVED0;
  vu16 CR2;
  u16  RESERVED1;
  vu16 OAR1;
  u16  RESERVED2;
  vu16 OAR2;
  u16  RESERVED3;
  vu16 DR;
  u16  RESERVED4;
  vu16 SR1;
  u16  RESERVED5;
  vu16 SR2;
  u16  RESERVED6;
  vu16 CCR;
  u16  RESERVED7;
  vu16 TRISE;
  u16  RESERVED8;
} I2C_TypeDef;

 
typedef struct
{
  vu32 KR;
  vu32 PR;
  vu32 RLR;
  vu32 SR;
} IWDG_TypeDef;

 
typedef struct
{
  vu32 ISER[2];
  u32  RESERVED0[30];
  vu32 ICER[2];
  u32  RSERVED1[30];
  vu32 ISPR[2];
  u32  RESERVED2[30];
  vu32 ICPR[2];
  u32  RESERVED3[30];
  vu32 IABR[2];
  u32  RESERVED4[62];
  vu32 IPR[15];
} NVIC_TypeDef;

typedef struct
{
  vuc32 CPUID;
  vu32 ICSR;
  vu32 VTOR;
  vu32 AIRCR;
  vu32 SCR;
  vu32 CCR;
  vu32 SHPR[3];
  vu32 SHCSR;
  vu32 CFSR;
  vu32 HFSR;
  vu32 DFSR;
  vu32 MMFAR;
  vu32 BFAR;
  vu32 AFSR;
} SCB_TypeDef;

 
typedef struct
{
  vu32 CR;
  vu32 CSR;
} PWR_TypeDef;

 
typedef struct
{
  vu32 CR;
  vu32 CFGR;
  vu32 CIR;
  vu32 APB2RSTR;
  vu32 APB1RSTR;
  vu32 AHBENR;
  vu32 APB2ENR;
  vu32 APB1ENR;
  vu32 BDCR;
  vu32 CSR;
} RCC_TypeDef;

 
typedef struct
{
  vu16 CRH;
  u16  RESERVED0;
  vu16 CRL;
  u16  RESERVED1;
  vu16 PRLH;
  u16  RESERVED2;
  vu16 PRLL;
  u16  RESERVED3;
  vu16 DIVH;
  u16  RESERVED4;
  vu16 DIVL;
  u16  RESERVED5;
  vu16 CNTH;
  u16  RESERVED6;
  vu16 CNTL;
  u16  RESERVED7;
  vu16 ALRH;
  u16  RESERVED8;
  vu16 ALRL;
  u16  RESERVED9;
} RTC_TypeDef;

 
typedef struct
{
  vu32 POWER;
  vu32 CLKCR;
  vu32 ARG;
  vu32 CMD;
  vuc32 RESPCMD;
  vuc32 RESP1;
  vuc32 RESP2;
  vuc32 RESP3;
  vuc32 RESP4;
  vu32 DTIMER;
  vu32 DLEN;
  vu32 DCTRL;
  vuc32 DCOUNT;
  vuc32 STA;
  vu32 ICR;
  vu32 MASK;
  u32  RESERVED0[2];
  vuc32 FIFOCNT;
  u32  RESERVED1[13];
  vu32 FIFO;
} SDIO_TypeDef;

 
typedef struct
{
  vu16 CR1;
  u16  RESERVED0;
  vu16 CR2;
  u16  RESERVED1;
  vu16 SR;
  u16  RESERVED2;
  vu16 DR;
  u16  RESERVED3;
  vu16 CRCPR;
  u16  RESERVED4;
  vu16 RXCRCR;
  u16  RESERVED5;
  vu16 TXCRCR;
  u16  RESERVED6;
  vu16 I2SCFGR;
  u16  RESERVED7;
  vu16 I2SPR;
  u16  RESERVED8;  
} SPI_TypeDef;

 
typedef struct
{
  vu32 CTRL;
  vu32 LOAD;
  vu32 VAL;
  vuc32 CALIB;
} SysTick_TypeDef;

 
typedef struct
{
  vu16 CR1;
  u16  RESERVED0;
  vu16 CR2;
  u16  RESERVED1;
  vu16 SMCR;
  u16  RESERVED2;
  vu16 DIER;
  u16  RESERVED3;
  vu16 SR;
  u16  RESERVED4;
  vu16 EGR;
  u16  RESERVED5;
  vu16 CCMR1;
  u16  RESERVED6;
  vu16 CCMR2;
  u16  RESERVED7;
  vu16 CCER;
  u16  RESERVED8;
  vu16 CNT;
  u16  RESERVED9;
  vu16 PSC;
  u16  RESERVED10;
  vu16 ARR;
  u16  RESERVED11;
  vu16 RCR;
  u16  RESERVED12;
  vu16 CCR1;
  u16  RESERVED13;
  vu16 CCR2;
  u16  RESERVED14;
  vu16 CCR3;
  u16  RESERVED15;
  vu16 CCR4;
  u16  RESERVED16;
  vu16 BDTR;
  u16  RESERVED17;
  vu16 DCR;
  u16  RESERVED18;
  vu16 DMAR;
  u16  RESERVED19;
} TIM_TypeDef;

 
typedef struct
{
  vu16 SR;
  u16  RESERVED0;
  vu16 DR;
  u16  RESERVED1;
  vu16 BRR;
  u16  RESERVED2;
  vu16 CR1;
  u16  RESERVED3;
  vu16 CR2;
  u16  RESERVED4;
  vu16 CR3;
  u16  RESERVED5;
  vu16 GTPR;
  u16  RESERVED6;
} USART_TypeDef;

 
typedef struct
{
  vu32 CR;
  vu32 CFR;
  vu32 SR;
} WWDG_TypeDef;

 
 
 
 



 



 


 




#line 634 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"

#line 651 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"



#line 670 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"

 

 


 






 


 






 
 
 

 



























































































































































































































#line 924 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"














 
#line 1180 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_map.h"

 
 
 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"

#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 
 
typedef struct
{
  u32 ADC_Mode;
  FunctionalState ADC_ScanConvMode; 
  FunctionalState ADC_ContinuousConvMode;
  u32 ADC_ExternalTrigConv;
  u32 ADC_DataAlign;
  u8 ADC_NbrOfChannel;
}ADC_InitTypeDef;

 



                                 



 
#line 55 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

#line 66 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 
 
#line 75 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"
 


 
#line 85 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

#line 100 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 






 
#line 127 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

#line 137 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 
#line 147 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

#line 156 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 
 





 



 






#line 188 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 










 
#line 208 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

#line 216 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_adc.h"

 








 











 


 


 


 


 


 


 


 
 
void ADC_DeInit(ADC_TypeDef* ADCx);
void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct);
void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct);
void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState);
void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState);
void ADC_ITConfig(ADC_TypeDef* ADCx, u16 ADC_IT, FunctionalState NewState);
void ADC_ResetCalibration(ADC_TypeDef* ADCx);
FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx);
void ADC_StartCalibration(ADC_TypeDef* ADCx);
FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx);
void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx);
void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, u8 Number);
void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, u8 ADC_Channel, u8 Rank, u8 ADC_SampleTime);
void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
u16 ADC_GetConversionValue(ADC_TypeDef* ADCx);
u32 ADC_GetDualModeConversionValue(void);
void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, u32 ADC_ExternalTrigInjecConv);
void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
void ADC_SoftwareStartInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState);
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx);
void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, u8 ADC_Channel, u8 Rank, u8 ADC_SampleTime);
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, u8 Length);
void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, u8 ADC_InjectedChannel, u16 Offset);
u16 ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, u8 ADC_InjectedChannel);
void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, u32 ADC_AnalogWatchdog);
void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, u16 HighThreshold, u16 LowThreshold);
void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, u8 ADC_Channel);
void ADC_TempSensorVrefintCmd(FunctionalState NewState);
FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, u8 ADC_FLAG);
void ADC_ClearFlag(ADC_TypeDef* ADCx, u8 ADC_FLAG);
ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, u16 ADC_IT);
void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, u16 ADC_IT);



 
#line 26 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_bkp.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_bkp.h"

 
 
 






 










 
#line 87 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_bkp.h"

#line 102 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_bkp.h"



 
 
void BKP_DeInit(void);
void BKP_TamperPinLevelConfig(u16 BKP_TamperPinLevel);
void BKP_TamperPinCmd(FunctionalState NewState);
void BKP_ITConfig(FunctionalState NewState);
void BKP_RTCOutputConfig(u16 BKP_RTCOutputSource);
void BKP_SetRTCCalibrationValue(u8 CalibrationValue);
void BKP_WriteBackupRegister(u16 BKP_DR, u16 Data);
u16 BKP_ReadBackupRegister(u16 BKP_DR);
FlagStatus BKP_GetFlagStatus(void);
void BKP_ClearFlag(void);
ITStatus BKP_GetITStatus(void);
void BKP_ClearITPendingBit(void);



 
#line 30 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"

 
 
typedef struct
{
  FunctionalState CAN_TTCM;
  FunctionalState CAN_ABOM;
  FunctionalState CAN_AWUM;
  FunctionalState CAN_NART;
  FunctionalState CAN_RFLM;
  FunctionalState CAN_TXFP;
  u8 CAN_Mode;
  u8 CAN_SJW;
  u8 CAN_BS1;
  u8 CAN_BS2;
  u16 CAN_Prescaler;
} CAN_InitTypeDef;

 
typedef struct
{
  u8 CAN_FilterNumber;
  u8 CAN_FilterMode;
  u8 CAN_FilterScale;
  u16 CAN_FilterIdHigh;
  u16 CAN_FilterIdLow;
  u16 CAN_FilterMaskIdHigh;
  u16 CAN_FilterMaskIdLow;
  u16 CAN_FilterFIFOAssignment;
  FunctionalState CAN_FilterActivation;
} CAN_FilterInitTypeDef;

 
typedef struct
{
  u32 StdId;
  u32 ExtId;
  u8 IDE;
  u8 RTR;
  u8 DLC;
  u8 Data[8];
} CanTxMsg;

 
typedef struct
{
  u32 StdId;
  u32 ExtId;
  u8 IDE;
  u8 RTR;
  u8 DLC;
  u8 Data[8];
  u8 FMI;
} CanRxMsg;

 

 



 








 








 
#line 119 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"



 
#line 131 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"



 


 


 






 






 






 





 





 





 





 





 



 



 







 
#line 225 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"

#line 233 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"

#line 240 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_can.h"

 
 
void CAN_DeInit(void);
u8 CAN_Init(CAN_InitTypeDef* CAN_InitStruct);
void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct);
void CAN_StructInit(CAN_InitTypeDef* CAN_InitStruct);
void CAN_ITConfig(u32 CAN_IT, FunctionalState NewState);
u8 CAN_Transmit(CanTxMsg* TxMessage);
u8 CAN_TransmitStatus(u8 TransmitMailbox);
void CAN_CancelTransmit(u8 Mailbox);
void CAN_FIFORelease(u8 FIFONumber);
u8 CAN_MessagePending(u8 FIFONumber);
void CAN_Receive(u8 FIFONumber, CanRxMsg* RxMessage);
u8 CAN_Sleep(void);
u8 CAN_WakeUp(void);
FlagStatus CAN_GetFlagStatus(u32 CAN_FLAG);
void CAN_ClearFlag(u32 CAN_FLAG);
ITStatus CAN_GetITStatus(u32 CAN_IT);
void CAN_ClearITPendingBit(u32 CAN_IT);



 
#line 34 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_crc.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_crc.h"

 
 
 
 
void CRC_ResetDR(void);
u32 CRC_CalcCRC(u32 Data);
u32 CRC_CalcBlockCRC(u32 pBuffer[], u32 BufferLength);
u32 CRC_GetCRC(void);
void CRC_SetIDRegister(u8 IDValue);
u8 CRC_GetIDRegister(void);



 
#line 38 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"

 
 
typedef struct
{
  u32 DAC_Trigger;
  u32 DAC_WaveGeneration;
  u32 DAC_LFSRUnmask_TriangleAmplitude;
  u32 DAC_OutputBuffer; 
}DAC_InitTypeDef;

 
 
#line 45 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"

#line 55 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"

 








 
#line 78 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"

#line 91 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"

#line 116 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dac.h"

 






 






 








 






 


 
 
void DAC_DeInit(void);
void DAC_Init(u32 DAC_Channel, DAC_InitTypeDef* DAC_InitStruct);
void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct);
void DAC_Cmd(u32 DAC_Channel, FunctionalState NewState);
void DAC_DMACmd(u32 DAC_Channel, FunctionalState NewState);
void DAC_SoftwareTriggerCmd(u32 DAC_Channel, FunctionalState NewState);
void DAC_DualSoftwareTriggerCmd(FunctionalState NewState);
void DAC_WaveGenerationCmd(u32 DAC_Channel, u32 DAC_Wave, FunctionalState NewState);
void DAC_SetChannel1Data(u32 DAC_Align, u16 Data);
void DAC_SetChannel2Data(u32 DAC_Align, u16 Data);
void DAC_SetDualChannelData(u32 DAC_Align, u16 Data2, u16 Data1);
u16 DAC_GetDataOutputValue(u32 DAC_Channel);



 
#line 42 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dbgmcu.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dbgmcu.h"

 
 
#line 42 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dbgmcu.h"
                                           


 
 
u32 DBGMCU_GetREVID(void);
u32 DBGMCU_GetDEVID(void);
void DBGMCU_Config(u32 DBGMCU_Periph, FunctionalState NewState);



 


#line 46 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"

 
 
typedef struct
{
  u32 DMA_PeripheralBaseAddr;
  u32 DMA_MemoryBaseAddr;
  u32 DMA_DIR;
  u32 DMA_BufferSize;
  u32 DMA_PeripheralInc;
  u32 DMA_MemoryInc;
  u32 DMA_PeripheralDataSize;
  u32 DMA_MemoryDataSize;
  u32 DMA_Mode;
  u32 DMA_Priority;
  u32 DMA_M2M;
}DMA_InitTypeDef;

 
#line 54 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"

 






 






 






 








 








 





 










 





 






 
#line 153 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"
 
#line 174 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"

#line 200 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"

 
 
#line 231 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"
 
#line 252 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"

#line 278 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_dma.h"

 


 
 
void DMA_DeInit(DMA_Channel_TypeDef* DMAy_Channelx);
void DMA_Init(DMA_Channel_TypeDef* DMAy_Channelx, DMA_InitTypeDef* DMA_InitStruct);
void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct);
void DMA_Cmd(DMA_Channel_TypeDef* DMAy_Channelx, FunctionalState NewState);
void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, u32 DMA_IT, FunctionalState NewState);
u16 DMA_GetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx);
FlagStatus DMA_GetFlagStatus(u32 DMA_FLAG);
void DMA_ClearFlag(u32 DMA_FLAG);
ITStatus DMA_GetITStatus(u32 DMA_IT);
void DMA_ClearITPendingBit(u32 DMA_IT);



 
#line 50 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_exti.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_exti.h"

 
 
typedef enum
{
  EXTI_Mode_Interrupt = 0x00,
  EXTI_Mode_Event = 0x04
}EXTIMode_TypeDef;


                            
 
typedef enum
{
  EXTI_Trigger_Rising = 0x08,
  EXTI_Trigger_Falling = 0x0C,  
  EXTI_Trigger_Rising_Falling = 0x10
}EXTITrigger_TypeDef;





 
typedef struct
{
  u32 EXTI_Line;
  EXTIMode_TypeDef EXTI_Mode;
  EXTITrigger_TypeDef EXTI_Trigger;
  FunctionalState EXTI_LineCmd;
}EXTI_InitTypeDef;

 
 
#line 80 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_exti.h"



#line 93 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_exti.h"
                                 
 
 
void EXTI_DeInit(void);
void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
void EXTI_GenerateSWInterrupt(u32 EXTI_Line);
FlagStatus EXTI_GetFlagStatus(u32 EXTI_Line);
void EXTI_ClearFlag(u32 EXTI_Line);
ITStatus EXTI_GetITStatus(u32 EXTI_Line);
void EXTI_ClearITPendingBit(u32 EXTI_Line);



 
#line 54 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_flash.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_flash.h"

 

 
typedef enum
{ 
  FLASH_BUSY = 1,
  FLASH_ERROR_PG,
  FLASH_ERROR_WRP,
  FLASH_COMPLETE,
  FLASH_TIMEOUT
}FLASH_Status;


 








 







 







 

 
#line 97 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_flash.h"

 
#line 132 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_flash.h"






 





 





 





 





 





 






								 
 
 
 
void FLASH_SetLatency(u32 FLASH_Latency);
void FLASH_HalfCycleAccessCmd(u32 FLASH_HalfCycleAccess);
void FLASH_PrefetchBufferCmd(u32 FLASH_PrefetchBuffer);


void FLASH_Unlock(void);
void FLASH_Lock(void);
FLASH_Status FLASH_ErasePage(u32 Page_Address);
FLASH_Status FLASH_EraseAllPages(void);
FLASH_Status FLASH_EraseOptionBytes(void);
FLASH_Status FLASH_ProgramWord(u32 Address, u32 Data);
FLASH_Status FLASH_ProgramHalfWord(u32 Address, u16 Data);
FLASH_Status FLASH_ProgramOptionByteData(u32 Address, u8 Data);
FLASH_Status FLASH_EnableWriteProtection(u32 FLASH_Pages);
FLASH_Status FLASH_ReadOutProtection(FunctionalState NewState);
FLASH_Status FLASH_UserOptionByteConfig(u16 OB_IWDG, u16 OB_STOP, u16 OB_STDBY);
u32 FLASH_GetUserOptionByte(void);
u32 FLASH_GetWriteProtectionOptionByte(void);
FlagStatus FLASH_GetReadOutProtectionStatus(void);
FlagStatus FLASH_GetPrefetchBufferStatus(void);
void FLASH_ITConfig(u16 FLASH_IT, FunctionalState NewState);
FlagStatus FLASH_GetFlagStatus(u16 FLASH_FLAG);
void FLASH_ClearFlag(u16 FLASH_FLAG);
FLASH_Status FLASH_GetStatus(void);
FLASH_Status FLASH_WaitForLastOperation(u32 Timeout);




 
#line 58 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_fsmc.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_fsmc.h"

 
 
typedef struct
{
  u32 FSMC_AddressSetupTime;
  u32 FSMC_AddressHoldTime;
  u32 FSMC_DataSetupTime;
  u32 FSMC_BusTurnAroundDuration;
  u32 FSMC_CLKDivision;
  u32 FSMC_DataLatency;
  u32 FSMC_AccessMode;
}FSMC_NORSRAMTimingInitTypeDef;

 
typedef struct
{
  u32 FSMC_Bank;
  u32 FSMC_DataAddressMux;
  u32 FSMC_MemoryType;
  u32 FSMC_MemoryDataWidth;
  u32 FSMC_BurstAccessMode;
  u32 FSMC_WaitSignalPolarity;
  u32 FSMC_WrapMode;
  u32 FSMC_WaitSignalActive;
  u32 FSMC_WriteOperation;
  u32 FSMC_WaitSignal;
  u32 FSMC_ExtendedMode;
  u32 FSMC_AsyncWait;
  u32 FSMC_WriteBurst;
   
  FSMC_NORSRAMTimingInitTypeDef* FSMC_ReadWriteTimingStruct;
   
  FSMC_NORSRAMTimingInitTypeDef* FSMC_WriteTimingStruct;
}FSMC_NORSRAMInitTypeDef;

 
typedef struct
{
  u32 FSMC_SetupTime;
  u32 FSMC_WaitSetupTime;
  u32 FSMC_HoldSetupTime;
  u32 FSMC_HiZSetupTime;
}FSMC_NAND_PCCARDTimingInitTypeDef;

 
typedef struct
{
  u32 FSMC_Bank;
  u32 FSMC_Waitfeature;
  u32 FSMC_MemoryDataWidth;
  u32 FSMC_ECC;
  u32 FSMC_ECCPageSize;
  u32 FSMC_AddressLowMapping;
  u32 FSMC_TCLRSetupTime;
  u32 FSMC_TARSetupTime;
   
  FSMC_NAND_PCCARDTimingInitTypeDef*  FSMC_CommonSpaceTimingStruct;
   
  FSMC_NAND_PCCARDTimingInitTypeDef*  FSMC_AttributeSpaceTimingStruct;
}FSMC_NANDInitTypeDef;

 
typedef struct
{
  u32 FSMC_Waitfeature;
  u32 FSMC_AddressLowMapping;
  u32 FSMC_TCLRSetupTime;
  u32 FSMC_TARSetupTime;
   
  FSMC_NAND_PCCARDTimingInitTypeDef*  FSMC_CommonSpaceTimingStruct;
   
  FSMC_NAND_PCCARDTimingInitTypeDef*  FSMC_AttributeSpaceTimingStruct;
   
  FSMC_NAND_PCCARDTimingInitTypeDef*  FSMC_IOSpaceTimingStruct;
}FSMC_PCCARDInitTypeDef;

 
 
#line 109 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_fsmc.h"













                                    





 
 






 









                                     
 





                                      
                               
 






                                   





                                        
  





                                 
                                  





                                    
 





                              
 






 





                               
 





                                  
                                   






 


 


 


 


 


 


 









                                  
 
 





                                    
 





                                    
 





                                            
 
#line 276 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_fsmc.h"

#line 283 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_fsmc.h"
                                                              
 





 


 


 


 


 


 


 










 











 
 
void FSMC_NORSRAMDeInit(u32 FSMC_Bank);
void FSMC_NANDDeInit(u32 FSMC_Bank);
void FSMC_PCCARDDeInit(void);
void FSMC_NORSRAMInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct);
void FSMC_NANDInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct);
void FSMC_PCCARDInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct);
void FSMC_NORSRAMStructInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct);
void FSMC_NANDStructInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct);
void FSMC_PCCARDStructInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct);
void FSMC_NORSRAMCmd(u32 FSMC_Bank, FunctionalState NewState);
void FSMC_NANDCmd(u32 FSMC_Bank, FunctionalState NewState);
void FSMC_PCCARDCmd(FunctionalState NewState);
void FSMC_NANDECCCmd(u32 FSMC_Bank, FunctionalState NewState);
u32 FSMC_GetECC(u32 FSMC_Bank);
void FSMC_ITConfig(u32 FSMC_Bank, u32 FSMC_IT, FunctionalState NewState);
FlagStatus FSMC_GetFlagStatus(u32 FSMC_Bank, u32 FSMC_FLAG);
void FSMC_ClearFlag(u32 FSMC_Bank, u32 FSMC_FLAG);
ITStatus FSMC_GetITStatus(u32 FSMC_Bank, u32 FSMC_IT);
void FSMC_ClearITPendingBit(u32 FSMC_Bank, u32 FSMC_IT);



 
#line 62 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"

 
#line 32 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"
                                     
 
typedef enum
{ 
  GPIO_Speed_10MHz = 1,
  GPIO_Speed_2MHz, 
  GPIO_Speed_50MHz
}GPIOSpeed_TypeDef;



                                         
 
typedef enum
{ GPIO_Mode_AIN = 0x0,
  GPIO_Mode_IN_FLOATING = 0x04,
  GPIO_Mode_IPD = 0x28,
  GPIO_Mode_IPU = 0x48,
  GPIO_Mode_Out_OD = 0x14,
  GPIO_Mode_Out_PP = 0x10,
  GPIO_Mode_AF_OD = 0x1C,
  GPIO_Mode_AF_PP = 0x18
}GPIOMode_TypeDef;





                              
 
typedef struct
{
  u16 GPIO_Pin;
  GPIOSpeed_TypeDef GPIO_Speed;
  GPIOMode_TypeDef GPIO_Mode;
}GPIO_InitTypeDef;

 
typedef enum
{ Bit_RESET = 0,
  Bit_SET
}BitAction;


 
 
#line 95 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"



#line 114 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"
                            
 
#line 141 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"


#line 156 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"
                              
 
#line 165 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"






                                         
#line 179 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"
                                       
 
#line 197 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"

#line 214 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_gpio.h"
                          
 
 
void GPIO_DeInit(GPIO_TypeDef* GPIOx);
void GPIO_AFIODeInit(void);
void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct);
void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct);
u8 GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin);
u16 GPIO_ReadInputData(GPIO_TypeDef* GPIOx);
u8 GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin);
u16 GPIO_ReadOutputData(GPIO_TypeDef* GPIOx);
void GPIO_SetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin);
void GPIO_ResetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin);
void GPIO_WriteBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin, BitAction BitVal);
void GPIO_Write(GPIO_TypeDef* GPIOx, u16 PortVal);
void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, u16 GPIO_Pin);
void GPIO_EventOutputConfig(u8 GPIO_PortSource, u8 GPIO_PinSource);
void GPIO_EventOutputCmd(FunctionalState NewState);
void GPIO_PinRemapConfig(u32 GPIO_Remap, FunctionalState NewState);
void GPIO_EXTILineConfig(u8 GPIO_PortSource, u8 GPIO_PinSource);



 
#line 66 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

 
 
typedef struct
{
  u16 I2C_Mode;
  u16 I2C_DutyCycle;
  u16 I2C_OwnAddress1;
  u16 I2C_Ack;
  u16 I2C_AcknowledgedAddress;
  u32 I2C_ClockSpeed;
}I2C_InitTypeDef;

 



 







 






 






 






 






 
#line 86 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

#line 96 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

 






 






 






 
#line 133 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

#line 140 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

#line 148 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

 
#line 171 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

#line 178 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

#line 190 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

 
 






 

     
 


 


 


 



 


 

      
 

                                          
 


#line 246 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_i2c.h"

 

 


 
 
void I2C_DeInit(I2C_TypeDef* I2Cx);
void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct);
void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct);
void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, u8 Address);
void I2C_DualAddressCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_GeneralCallCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_ITConfig(I2C_TypeDef* I2Cx, u16 I2C_IT, FunctionalState NewState);
void I2C_SendData(I2C_TypeDef* I2Cx, u8 Data);
u8 I2C_ReceiveData(I2C_TypeDef* I2Cx);
void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, u8 Address, u8 I2C_Direction);
u16 I2C_ReadRegister(I2C_TypeDef* I2Cx, u8 I2C_Register);
void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, u16 I2C_SMBusAlert);
void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, u16 I2C_PECPosition);
void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState);
u8 I2C_GetPEC(I2C_TypeDef* I2Cx);
void I2C_ARPCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, u16 I2C_DutyCycle);
u32 I2C_GetLastEvent(I2C_TypeDef* I2Cx);
ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, u32 I2C_EVENT);
FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, u32 I2C_FLAG);
void I2C_ClearFlag(I2C_TypeDef* I2Cx, u32 I2C_FLAG);
ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, u32 I2C_IT);
void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, u32 I2C_IT);



 
#line 70 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_iwdg.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_iwdg.h"

 
 
 






 
#line 41 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_iwdg.h"

#line 49 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_iwdg.h"

 







 
 
void IWDG_WriteAccessCmd(u16 IWDG_WriteAccess);
void IWDG_SetPrescaler(u8 IWDG_Prescaler);
void IWDG_SetReload(u16 Reload);
void IWDG_ReloadCounter(void);
void IWDG_Enable(void);
FlagStatus IWDG_GetFlagStatus(u16 IWDG_FLAG);



 
#line 74 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"

 
 
typedef struct
{
  u8 NVIC_IRQChannel;
  u8 NVIC_IRQChannelPreemptionPriority;
  u8 NVIC_IRQChannelSubPriority;
  FunctionalState NVIC_IRQChannelCmd;
} NVIC_InitTypeDef;

 
 
#line 96 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"


#line 158 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"


 
#line 170 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"





#line 182 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"












#line 201 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"











 






 








 
#line 239 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_nvic.h"












 
 
void NVIC_DeInit(void);
void NVIC_SCBDeInit(void);
void NVIC_PriorityGroupConfig(u32 NVIC_PriorityGroup);
void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
void NVIC_StructInit(NVIC_InitTypeDef* NVIC_InitStruct);
void NVIC_SETPRIMASK(void);
void NVIC_RESETPRIMASK(void);
void NVIC_SETFAULTMASK(void);
void NVIC_RESETFAULTMASK(void);
void NVIC_BASEPRICONFIG(u32 NewPriority);
u32 NVIC_GetBASEPRI(void);
u16 NVIC_GetCurrentPendingIRQChannel(void);
ITStatus NVIC_GetIRQChannelPendingBitStatus(u8 NVIC_IRQChannel);
void NVIC_SetIRQChannelPendingBit(u8 NVIC_IRQChannel);
void NVIC_ClearIRQChannelPendingBit(u8 NVIC_IRQChannel);
u16 NVIC_GetCurrentActiveHandler(void);
ITStatus NVIC_GetIRQChannelActiveBitStatus(u8 NVIC_IRQChannel);
u32 NVIC_GetCPUID(void);
void NVIC_SetVectorTable(u32 NVIC_VectTab, u32 Offset);
void NVIC_GenerateSystemReset(void);
void NVIC_GenerateCoreReset(void);
void NVIC_SystemLPConfig(u8 LowPowerMode, FunctionalState NewState);
void NVIC_SystemHandlerConfig(u32 SystemHandler, FunctionalState NewState);
void NVIC_SystemHandlerPriorityConfig(u32 SystemHandler, u8 SystemHandlerPreemptionPriority,
                                      u8 SystemHandlerSubPriority);
ITStatus NVIC_GetSystemHandlerPendingBitStatus(u32 SystemHandler);
void NVIC_SetSystemHandlerPendingBit(u32 SystemHandler);
void NVIC_ClearSystemHandlerPendingBit(u32 SystemHandler);
ITStatus NVIC_GetSystemHandlerActiveBitStatus(u32 SystemHandler);
u32 NVIC_GetFaultHandlerSources(u32 SystemHandler);
u32 NVIC_GetFaultAddress(u32 SystemHandler);



 
#line 78 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_pwr.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_pwr.h"

 
 
 
#line 35 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_pwr.h"






 






 




 
 








 
 
void PWR_DeInit(void);
void PWR_BackupAccessCmd(FunctionalState NewState);
void PWR_PVDCmd(FunctionalState NewState);
void PWR_PVDLevelConfig(u32 PWR_PVDLevel);
void PWR_WakeUpPinCmd(FunctionalState NewState);
void PWR_EnterSTOPMode(u32 PWR_Regulator, u8 PWR_STOPEntry);
void PWR_EnterSTANDBYMode(void);
FlagStatus PWR_GetFlagStatus(u32 PWR_FLAG);
void PWR_ClearFlag(u32 PWR_FLAG);



 
#line 82 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"

 
typedef struct
{
  u32 SYSCLK_Frequency;
  u32 HCLK_Frequency;
  u32 PCLK1_Frequency;
  u32 PCLK2_Frequency;
  u32 ADCCLK_Frequency;
}RCC_ClocksTypeDef;

 
 







 








 
#line 68 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"

#line 77 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"

 








 
#line 97 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"







 










 
#line 122 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"







 






 








 







 








 
#line 170 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"



 
#line 190 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"



 
#line 215 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"



 










 
#line 241 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"

#line 248 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rcc.h"



 
 
void RCC_DeInit(void);
void RCC_HSEConfig(u32 RCC_HSE);
ErrorStatus RCC_WaitForHSEStartUp(void);
void RCC_AdjustHSICalibrationValue(u8 HSICalibrationValue);
void RCC_HSICmd(FunctionalState NewState);
void RCC_PLLConfig(u32 RCC_PLLSource, u32 RCC_PLLMul);
void RCC_PLLCmd(FunctionalState NewState);
void RCC_SYSCLKConfig(u32 RCC_SYSCLKSource);
u8 RCC_GetSYSCLKSource(void);
void RCC_HCLKConfig(u32 RCC_SYSCLK);
void RCC_PCLK1Config(u32 RCC_HCLK);
void RCC_PCLK2Config(u32 RCC_HCLK);
void RCC_ITConfig(u8 RCC_IT, FunctionalState NewState);
void RCC_USBCLKConfig(u32 RCC_USBCLKSource);
void RCC_ADCCLKConfig(u32 RCC_PCLK2);
void RCC_LSEConfig(u8 RCC_LSE);
void RCC_LSICmd(FunctionalState NewState);
void RCC_RTCCLKConfig(u32 RCC_RTCCLKSource);
void RCC_RTCCLKCmd(FunctionalState NewState);
void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks);
void RCC_AHBPeriphClockCmd(u32 RCC_AHBPeriph, FunctionalState NewState);
void RCC_APB2PeriphClockCmd(u32 RCC_APB2Periph, FunctionalState NewState);
void RCC_APB1PeriphClockCmd(u32 RCC_APB1Periph, FunctionalState NewState);
void RCC_APB2PeriphResetCmd(u32 RCC_APB2Periph, FunctionalState NewState);
void RCC_APB1PeriphResetCmd(u32 RCC_APB1Periph, FunctionalState NewState);
void RCC_BackupResetCmd(FunctionalState NewState);
void RCC_ClockSecuritySystemCmd(FunctionalState NewState);
void RCC_MCOConfig(u8 RCC_MCO);
FlagStatus RCC_GetFlagStatus(u8 RCC_FLAG);
void RCC_ClearFlag(void);
ITStatus RCC_GetITStatus(u8 RCC_IT);
void RCC_ClearITPendingBit(u8 RCC_IT);



 
#line 86 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rtc.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_rtc.h"

 
 
 








                                                                     
 













                           
 
 
void RTC_ITConfig(u16 RTC_IT, FunctionalState NewState);
void RTC_EnterConfigMode(void);
void RTC_ExitConfigMode(void);
u32  RTC_GetCounter(void);
void RTC_SetCounter(u32 CounterValue);
void RTC_SetPrescaler(u32 PrescalerValue);
void RTC_SetAlarm(u32 AlarmValue);
u32  RTC_GetDivider(void);
void RTC_WaitForLastTask(void);
void RTC_WaitForSynchro(void);
FlagStatus RTC_GetFlagStatus(u16 RTC_FLAG);
void RTC_ClearFlag(u16 RTC_FLAG);
ITStatus RTC_GetITStatus(u16 RTC_IT);
void RTC_ClearITPendingBit(u16 RTC_IT);



 
#line 90 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"

 
typedef struct
{
  u8 SDIO_ClockDiv;
  u32 SDIO_ClockEdge;
  u32 SDIO_ClockBypass;
  u32 SDIO_ClockPowerSave;
  u32 SDIO_BusWide;
  u32 SDIO_HardwareFlowControl;
} SDIO_InitTypeDef;

typedef struct
{
  u32 SDIO_Argument;
  u32 SDIO_CmdIndex;
  u32 SDIO_Response;
  u32 SDIO_Wait;
  u32 SDIO_CPSM;
} SDIO_CmdInitTypeDef;

typedef struct
{
  u32 SDIO_DataTimeOut;
  u32 SDIO_DataLength;
  u32 SDIO_DataBlockSize;
  u32 SDIO_TransferDir;
  u32 SDIO_TransferMode;
  u32 SDIO_DPSM;
} SDIO_DataInitTypeDef;

 
 





                                   






  






 






                                
  





                                  
 





 
#line 121 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"



 


 








 







 





 








 


 
#line 178 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"

#line 194 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"

 






 






 





 
#line 240 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"

#line 265 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"



#line 292 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_sdio.h"


                                                        
 






 
 
void SDIO_DeInit(void);
void SDIO_Init(SDIO_InitTypeDef* SDIO_InitStruct);
void SDIO_StructInit(SDIO_InitTypeDef* SDIO_InitStruct);
void SDIO_ClockCmd(FunctionalState NewState);
void SDIO_SetPowerState(u32 SDIO_PowerState);
u32 SDIO_GetPowerState(void);
void SDIO_ITConfig(u32 SDIO_IT, FunctionalState NewState);
void SDIO_DMACmd(FunctionalState NewState);
void SDIO_SendCommand(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct);
void SDIO_CmdStructInit(SDIO_CmdInitTypeDef* SDIO_CmdInitStruct);
u8 SDIO_GetCommandResponse(void);
u32 SDIO_GetResponse(u32 SDIO_RESP);
void SDIO_DataConfig(SDIO_DataInitTypeDef* SDIO_DataInitStruct);
void SDIO_DataStructInit(SDIO_DataInitTypeDef* SDIO_DataInitStruct);
u32 SDIO_GetDataCounter(void);
u32 SDIO_ReadData(void);
void SDIO_WriteData(u32 Data);
u32 SDIO_GetFIFOCount(void);
void SDIO_StartSDIOReadWait(FunctionalState NewState);
void SDIO_StopSDIOReadWait(FunctionalState NewState);
void SDIO_SetSDIOReadWaitMode(u32 SDIO_ReadWaitMode);
void SDIO_SetSDIOOperation(FunctionalState NewState);
void SDIO_SendSDIOSuspendCmd(FunctionalState NewState);
void SDIO_CommandCompletionCmd(FunctionalState NewState);
void SDIO_CEATAITCmd(FunctionalState NewState);
void SDIO_SendCEATACmd(FunctionalState NewState);
FlagStatus SDIO_GetFlagStatus(u32 SDIO_FLAG);
void SDIO_ClearFlag(u32 SDIO_FLAG);
ITStatus SDIO_GetITStatus(u32 SDIO_IT);
void SDIO_ClearITPendingBit(u32 SDIO_IT);



 
#line 94 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

 
 
typedef struct
{
  u16 SPI_Direction;
  u16 SPI_Mode;
  u16 SPI_DataSize;
  u16 SPI_CPOL;
  u16 SPI_CPHA;
  u16 SPI_NSS;
  u16 SPI_BaudRatePrescaler;
  u16 SPI_FirstBit;
  u16 SPI_CRCPolynomial;
}SPI_InitTypeDef;

 
typedef struct
{
  u16 I2S_Mode;
  u16 I2S_Standard;
  u16 I2S_DataFormat;
  u16 I2S_MCLKOutput;
  u16 I2S_AudioFreq;
  u16 I2S_CPOL;
}I2S_InitTypeDef;

 








 










 






 






 






 






 






 
#line 114 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

#line 123 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

 






 










 












 










  






 
#line 180 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

#line 187 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

 






 





 






 





 






 






















 
#line 253 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

#line 260 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_spi.h"

 


 
 
void SPI_I2S_DeInit(SPI_TypeDef* SPIx);
void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct);
void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct);
void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct);
void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct);
void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState);
void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState);
void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, u8 SPI_I2S_IT, FunctionalState NewState);
void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, u16 SPI_I2S_DMAReq, FunctionalState NewState);
void SPI_I2S_SendData(SPI_TypeDef* SPIx, u16 Data);
u16 SPI_I2S_ReceiveData(SPI_TypeDef* SPIx);
void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, u16 SPI_NSSInternalSoft);
void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState);
void SPI_DataSizeConfig(SPI_TypeDef* SPIx, u16 SPI_DataSize);
void SPI_TransmitCRC(SPI_TypeDef* SPIx);
void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState);
u16 SPI_GetCRC(SPI_TypeDef* SPIx, u8 SPI_CRC);
u16 SPI_GetCRCPolynomial(SPI_TypeDef* SPIx);
void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, u16 SPI_Direction);
FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, u16 SPI_I2S_FLAG);
void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, u16 SPI_I2S_FLAG);
ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, u8 SPI_I2S_IT);
void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, u8 SPI_I2S_IT);



 
#line 98 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_systick.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_systick.h"

 
 
 






 








 










 
 
void SysTick_CLKSourceConfig(u32 SysTick_CLKSource);
void SysTick_SetReload(u32 Reload);
void SysTick_CounterCmd(u32 SysTick_Counter);
void SysTick_ITConfig(FunctionalState NewState);
u32 SysTick_GetCounter(void);
FlagStatus SysTick_GetFlagStatus(u8 SysTick_FLAG);



 
#line 102 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 

 
typedef struct
{
  u16 TIM_Prescaler;
  u16 TIM_CounterMode;
  u16 TIM_Period;
  u16 TIM_ClockDivision;
  u8 TIM_RepetitionCounter;
} TIM_TimeBaseInitTypeDef;

 
typedef struct
{
  u16 TIM_OCMode;
  u16 TIM_OutputState;
  u16 TIM_OutputNState;
  u16 TIM_Pulse;
  u16 TIM_OCPolarity;
  u16 TIM_OCNPolarity;
  u16 TIM_OCIdleState;
  u16 TIM_OCNIdleState;
} TIM_OCInitTypeDef;

 
typedef struct
{
  u16 TIM_Channel;
  u16 TIM_ICPolarity;
  u16 TIM_ICSelection;
  u16 TIM_ICPrescaler;
  u16 TIM_ICFilter;
} TIM_ICInitTypeDef;

 
typedef struct
{
  u16 TIM_OSSRState;
  u16 TIM_OSSIState;
  u16 TIM_LOCKLevel; 
  u16 TIM_DeadTime;
  u16 TIM_Break;
  u16 TIM_BreakPolarity;
  u16 TIM_AutomaticOutput;
} TIM_BDTRInitTypeDef;

                              

#line 81 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"




#line 91 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 
#line 99 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 106 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 115 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"
 






 
















 








 












 






 






 






 






 






 






 






 






 





 










 






 






 






 






 






 








 










 
#line 298 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"



#line 308 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 317 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 
#line 338 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 358 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 
#line 378 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 397 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 
#line 406 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"



#line 416 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 










 
#line 437 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 446 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"






 








 






 






 






  








 
#line 500 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"



#line 510 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 






 






 





                                     
 






  
#line 548 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 557 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 593 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

 










 






 
#line 625 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 638 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 646 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"

#line 665 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_tim.h"
                                                                                            
 


 


 
 

void TIM_DeInit(TIM_TypeDef* TIMx);
void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct);
void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct);
void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct);
void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct);
void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct);
void TIM_OCStructInit(TIM_OCInitTypeDef* TIM_OCInitStruct);
void TIM_ICStructInit(TIM_ICInitTypeDef* TIM_ICInitStruct);
void TIM_BDTRStructInit(TIM_BDTRInitTypeDef* TIM_BDTRInitStruct);
void TIM_Cmd(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_ITConfig(TIM_TypeDef* TIMx, u16 TIM_IT, FunctionalState NewState);
void TIM_GenerateEvent(TIM_TypeDef* TIMx, u16 TIM_EventSource);
void TIM_DMAConfig(TIM_TypeDef* TIMx, u16 TIM_DMABase, u16 TIM_DMABurstLength);
void TIM_DMACmd(TIM_TypeDef* TIMx, u16 TIM_DMASource, FunctionalState NewState);
void TIM_InternalClockConfig(TIM_TypeDef* TIMx);
void TIM_ITRxExternalClockConfig(TIM_TypeDef* TIMx, u16 TIM_InputTriggerSource);
void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, u16 TIM_TIxExternalCLKSource,
                                u16 TIM_ICPolarity, u16 ICFilter);                                
void TIM_ETRClockMode1Config(TIM_TypeDef* TIMx, u16 TIM_ExtTRGPrescaler, u16 TIM_ExtTRGPolarity,
                             u16 ExtTRGFilter);
void TIM_ETRClockMode2Config(TIM_TypeDef* TIMx, u16 TIM_ExtTRGPrescaler, 
                             u16 TIM_ExtTRGPolarity, u16 ExtTRGFilter);
void TIM_ETRConfig(TIM_TypeDef* TIMx, u16 TIM_ExtTRGPrescaler, u16 TIM_ExtTRGPolarity,
                   u16 ExtTRGFilter);
void TIM_PrescalerConfig(TIM_TypeDef* TIMx, u16 Prescaler, u16 TIM_PSCReloadMode);
void TIM_CounterModeConfig(TIM_TypeDef* TIMx, u16 TIM_CounterMode);
void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, u16 TIM_InputTriggerSource);
void TIM_EncoderInterfaceConfig(TIM_TypeDef* TIMx, u16 TIM_EncoderMode,
                                u16 TIM_IC1Polarity, u16 TIM_IC2Polarity);
void TIM_ForcedOC1Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction);
void TIM_ForcedOC2Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction);
void TIM_ForcedOC3Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction);
void TIM_ForcedOC4Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction);
void TIM_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_SelectCOM(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_SelectCCDMA(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_CCPreloadControl(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_OC1PreloadConfig(TIM_TypeDef* TIMx, u16 TIM_OCPreload);
void TIM_OC2PreloadConfig(TIM_TypeDef* TIMx, u16 TIM_OCPreload);
void TIM_OC3PreloadConfig(TIM_TypeDef* TIMx, u16 TIM_OCPreload);
void TIM_OC4PreloadConfig(TIM_TypeDef* TIMx, u16 TIM_OCPreload);
void TIM_OC1FastConfig(TIM_TypeDef* TIMx, u16 TIM_OCFast);
void TIM_OC2FastConfig(TIM_TypeDef* TIMx, u16 TIM_OCFast);
void TIM_OC3FastConfig(TIM_TypeDef* TIMx, u16 TIM_OCFast);
void TIM_OC4FastConfig(TIM_TypeDef* TIMx, u16 TIM_OCFast);
void TIM_ClearOC1Ref(TIM_TypeDef* TIMx, u16 TIM_OCClear);
void TIM_ClearOC2Ref(TIM_TypeDef* TIMx, u16 TIM_OCClear);
void TIM_ClearOC3Ref(TIM_TypeDef* TIMx, u16 TIM_OCClear);
void TIM_ClearOC4Ref(TIM_TypeDef* TIMx, u16 TIM_OCClear);
void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity);
void TIM_OC1NPolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCNPolarity);
void TIM_OC2PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity);
void TIM_OC2NPolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCNPolarity);
void TIM_OC3PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity);
void TIM_OC3NPolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCNPolarity);
void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity);
void TIM_CCxCmd(TIM_TypeDef* TIMx, u16 TIM_Channel, u16 TIM_CCx);
void TIM_CCxNCmd(TIM_TypeDef* TIMx, u16 TIM_Channel, u16 TIM_CCxN);
void TIM_SelectOCxM(TIM_TypeDef* TIMx, u16 TIM_Channel, u16 TIM_OCMode);
void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, u16 TIM_UpdateSource);
void TIM_SelectHallSensor(TIM_TypeDef* TIMx, FunctionalState NewState);
void TIM_SelectOnePulseMode(TIM_TypeDef* TIMx, u16 TIM_OPMode);
void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, u16 TIM_TRGOSource);
void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, u16 TIM_SlaveMode);
void TIM_SelectMasterSlaveMode(TIM_TypeDef* TIMx, u16 TIM_MasterSlaveMode);
void TIM_SetCounter(TIM_TypeDef* TIMx, u16 Counter);
void TIM_SetAutoreload(TIM_TypeDef* TIMx, u16 Autoreload);
void TIM_SetCompare1(TIM_TypeDef* TIMx, u16 Compare1);
void TIM_SetCompare2(TIM_TypeDef* TIMx, u16 Compare2);
void TIM_SetCompare3(TIM_TypeDef* TIMx, u16 Compare3);
void TIM_SetCompare4(TIM_TypeDef* TIMx, u16 Compare4);
void TIM_SetIC1Prescaler(TIM_TypeDef* TIMx, u16 TIM_ICPSC);
void TIM_SetIC2Prescaler(TIM_TypeDef* TIMx, u16 TIM_ICPSC);
void TIM_SetIC3Prescaler(TIM_TypeDef* TIMx, u16 TIM_ICPSC);
void TIM_SetIC4Prescaler(TIM_TypeDef* TIMx, u16 TIM_ICPSC);
void TIM_SetClockDivision(TIM_TypeDef* TIMx, u16 TIM_CKD);
u16 TIM_GetCapture1(TIM_TypeDef* TIMx);
u16 TIM_GetCapture2(TIM_TypeDef* TIMx);
u16 TIM_GetCapture3(TIM_TypeDef* TIMx);
u16 TIM_GetCapture4(TIM_TypeDef* TIMx);
u16 TIM_GetCounter(TIM_TypeDef* TIMx);
u16 TIM_GetPrescaler(TIM_TypeDef* TIMx);
FlagStatus TIM_GetFlagStatus(TIM_TypeDef* TIMx, u16 TIM_FLAG);
void TIM_ClearFlag(TIM_TypeDef* TIMx, u16 TIM_FLAG);
ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, u16 TIM_IT);
void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, u16 TIM_IT);
                                                                                                             


 








#line 106 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_usart.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_usart.h"

 
 
typedef struct
{
  u32 USART_BaudRate;
  u16 USART_WordLength;
  u16 USART_StopBits;
  u16 USART_Parity;
  u16 USART_Mode;
  u16 USART_HardwareFlowControl;  
} USART_InitTypeDef;

 
typedef struct
{
  u16 USART_Clock;
  u16 USART_CPOL;
  u16 USART_CPHA;
  u16 USART_LastBit;
} USART_ClockInitTypeDef;

 















 


                                    



 









 








 





 















 






 




                               
 




 






 
#line 146 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_usart.h"






















 





 






 







 






 
#line 207 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_usart.h"






                              










 
 
void USART_DeInit(USART_TypeDef* USARTx);
void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct);
void USART_StructInit(USART_InitTypeDef* USART_InitStruct);
void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USART_ClockInitStruct);
void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct);
void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_ITConfig(USART_TypeDef* USARTx, u16 USART_IT, FunctionalState NewState);
void USART_DMACmd(USART_TypeDef* USARTx, u16 USART_DMAReq, FunctionalState NewState);
void USART_SetAddress(USART_TypeDef* USARTx, u8 USART_Address);
void USART_WakeUpConfig(USART_TypeDef* USARTx, u16 USART_WakeUp);
void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, u16 USART_LINBreakDetectLength);
void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_SendData(USART_TypeDef* USARTx, u16 Data);
u16 USART_ReceiveData(USART_TypeDef* USARTx);
void USART_SendBreak(USART_TypeDef* USARTx);
void USART_SetGuardTime(USART_TypeDef* USARTx, u8 USART_GuardTime);
void USART_SetPrescaler(USART_TypeDef* USARTx, u8 USART_Prescaler);
void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_IrDAConfig(USART_TypeDef* USARTx, u16 USART_IrDAMode);
void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState);
FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, u16 USART_FLAG);
void USART_ClearFlag(USART_TypeDef* USARTx, u16 USART_FLAG);
ITStatus USART_GetITStatus(USART_TypeDef* USARTx, u16 USART_IT);
void USART_ClearITPendingBit(USART_TypeDef* USARTx, u16 USART_IT);



 
#line 110 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


#line 1 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_wwdg.h"














 

 



 
#line 23 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_wwdg.h"

 
 
 














 
 
void WWDG_DeInit(void);
void WWDG_SetPrescaler(u32 WWDG_Prescaler);
void WWDG_SetWindowValue(u8 WindowValue);
void WWDG_EnableIT(void);
void WWDG_SetCounter(u8 Counter);
void WWDG_Enable(u8 Counter);
FlagStatus WWDG_GetFlagStatus(void);
void WWDG_ClearFlag(void);



 
#line 114 "..\\config\\..\\gtlib\\gtDev\\STM32F10x\\stm32f10x_lib.h"


 
 
 
 
void debug(void);



 
#line 8 "..\\config\\Retarget.c"
#line 1 "..\\gtlib\\gtfs\\gtfs.h"










int  fs_io_Init(int index);
int  fs_io_format(void (*pCallback)());
int  fs_io_open(const char *name, const char *mode);
int  fs_io_write(const void *buffer,int size,int cnt,int fd);
int  fs_io_read(void *buffer,int size,int cnt,int fd);
int  fs_io_close(int fd);
int  fs_io_seek(int fd,long int offset,int whence);
int  fs_io_mkdir (const char *path);
int  fs_io_rm (const char *path);
int  fs_io_del(const char *path);
int  fs_io_rename (const char *oldpath,const char *newpath);
int  fs_io_list (const char *path);
long fs_io_len (int fd);
long fs_io_size (int fd);
long fs_io_sync (int fd);
int  fs_io_unlink (const char *name);
unsigned int fs_ffind (unsigned char code, unsigned char *buf, unsigned char *mask, unsigned int buflen);
int yaffs_io_close(int fp);


#line 46 "..\\gtlib\\gtfs\\gtfs.h"
	






#line 9 "..\\config\\Retarget.c"



 
#line 19 "..\\config\\Retarget.c"
	typedef signed char 				S8;
	typedef unsigned char				U8;
	typedef short						S16;
	typedef unsigned short				U16;
	typedef int 						S32;
	typedef unsigned int				U32;
	typedef long long					S64;
	typedef unsigned long long			U64;
	typedef volatile signed char		VS8;
	typedef volatile unsigned char		VU8;
	typedef volatile short				VS16;
	typedef volatile unsigned short 	VU16;
	typedef volatile int				VS32;
	typedef volatile unsigned int		VU32;
	typedef volatile long long			VS64;
	typedef volatile unsigned long long VU64;

	typedef unsigned char				BIT;
	typedef unsigned int				BOOL;

	typedef float						 fp32;					   
	typedef double						 fp64;					   




extern void RCC_Config(void);
extern void NVIC_Config(void);
extern void NVIC_boot_Config(void);		
extern void GPIO_INIT(void);				
extern void GPIO_INIT_F101(void);		
extern void GPIO_CFGBUS(void);
extern void IWDG_Config(void);
extern void FSMC_Config(U8 ucNand,U8 ucSram,U8 ucDM9000,U8 ucGUI,U8 ucNor);
extern BOOL UART_INIT(U8 xUart);
extern BOOL UART_SMARTCARD_INIT(U8 xUart,U8 ucClock,U8 ucBit);



 






extern int K9F1208_nand_Identify(void);
extern int K9F1208_nand_ReadPage(U32 *pPage, void *pBuf, U32 *pDataEcc, U8 nand_ecc);
extern int K9F1208_nand_ProgData(U32 *pPage, const void *pBuf, U32 *pDataEcc, U8 nand_ecc);
extern int K9F1208_nand_ProgHalfDouble(U32 *pPage, const void *pBuf0, const void *pBuf1, U32 *pDataEcc, U8 nand_ecc);
extern int K9F1208_nand_ProgSpare(U32 *pPage, const void *pBuf);
extern int K9F1208_nand_EraseBlock(U32 *pPage);


extern int K9F1G_nand_Identify(void);
extern int K9F1G_nand_ReadPage(U32 *pPage, void *pBuf, U32 *pDataEcc, U8 nand_ecc);
extern int K9F1G_nand_ProgData(U32 *pPage, const void *pBuf, U32 *pDataEcc, U8 nand_ecc);
extern int K9F1G_nand_EraseBlock(U32 *pPage);


int gt_nand_init(void)
{


	return (K9F1208_nand_Identify());





}

int gt_nand_readpage(U32 *pPage, void *pBuf, U32 *ppDataEcc)
{
	U32 DataEcc = 0;
	U32 *pDataEcc = &DataEcc;
	if(ppDataEcc)pDataEcc = ppDataEcc;  
	

	return (K9F1208_nand_ReadPage(pPage,pBuf,pDataEcc,0));






}

int gt_nand_progdata(U32 *pPage, const void *pBuf, U32 *ppDataEcc)
{
	
	U32 DataEcc = 0;
	U32 *pDataEcc = &DataEcc;
	if(ppDataEcc)pDataEcc = ppDataEcc;
	

	return (K9F1208_nand_ProgData(pPage,pBuf,pDataEcc,0));






}

int gt_nand_proghalfdouble(U32 *pPage, const void *pBuf0, const void *pBuf1, U32 *ppDataEcc)
{
	
	U32 DataEcc = 0;
	U32 *pDataEcc = &DataEcc;
	if(ppDataEcc)pDataEcc = ppDataEcc;
	

	return (K9F1208_nand_ProgHalfDouble(pPage,pBuf0,pBuf1,pDataEcc,0));






}

int gt_nand_progspare(U32 *pPage, const void *pBuf)
{

	return (K9F1208_nand_ProgSpare(pPage,pBuf));







}

int gt_nand_eraseblock(U32 *pPage)
{

	return (K9F1208_nand_EraseBlock(pPage));






}






 

extern int cpu_norf_Init(void);
extern int cpu_norf_Erase(U32 adr);
extern int cpu_norf_Program(U32 adr, const U32 *pBuf, U32 nLen);

extern int MX29GL128_norf_Erase(U32 adr);
extern int MX29GL128_norf_EraseChip(void);
extern int MX29GL128_norf_Program(U32 adr, const U32 *pBuf, U32 nLen);



int gt_norf_init(void)
{
	return (cpu_norf_Init());
}

int gt_norf_erase(U32 adr)
{
	if((adr >= 0x08000000)&&(adr <= 0x08080000))
	{
		return (cpu_norf_Erase(adr));
	}
	else
	{



		return 1;

	}
}

int gt_norf_erasechip(void)
{



	return 1;


}

int gt_norf_program(U32 adr, const U32 *pBuf, U32 nLen)
{
	if((adr >= 0x08000000)&&(adr <= 0x08080000))
	{
		return (cpu_norf_Program(adr,pBuf,nLen));
	}
	else
	{



		return 1;

	}
}

int gt_norf_read(U32 adr, void *pBuf, U32 nLen)
{
	memcpy(pBuf, (U32 *)adr, nLen);
	return 1;
}





 
extern U8 GUI_LCD_TYPE;
typedef struct
{
	U16 ucLcd_Xmax;
	U16 ucLcd_Ymax;
}gt_lcd_info1[1];




extern void T_160_UC1698_lcd_Init(void);
extern void T_160_UC1698_lcd_Bgl(int nOnOff);
extern void T_160_UC1698_lcd_DrawPoint(int x, int y, U8 color);
extern void T_160_UC1698_lcd_ClearAll(U8 color);
extern void T_160_UC1698_lcd_Redraw(void);
extern void T_160_UC1698_lcd_SetBR(char nBr);
extern void T_160_UC1698_lcd_SetPM(U8 nPm);
extern void T_160_UC1698_lcd_info(gt_lcd_info1 LCD_INFO);


extern void T_320_RA8835_lcd_Init(void);
extern void T_320_RA8835_lcd_Bgl(int nOnOff);
extern void T_320_RA8835_lcd_DrawPoint(int x, int y, U8 color);
extern void T_320_RA8835_lcd_ClearAll(U8 color);
extern void T_320_RA8835_lcd_Redraw(void);
extern void T_320_RA8835_lcd_info(gt_lcd_info1 LCD_INFO);

extern void T_128_SBN6400_lcd_Init(void);
extern void T_128_SBN6400_lcd_Bgl(int nOnOff);
extern void T_128_SBN6400_lcd_DrawPoint(int x, int y, U8 color);
extern void T_128_SBN6400_lcd_ClearAll(U8 color);
extern void T_128_SBN6400_lcd_Refresh(void);
extern void T_128_SBN6400_lcd_Redraw(void);
extern void T_128_SBN6400_lcd_info(gt_lcd_info1 LCD_INFO);


void gt_lcd_init(void)
{

	T_160_UC1698_lcd_Init();





}

void gt_lcd_bgl(int nOnOff)
{

	T_160_UC1698_lcd_Bgl(nOnOff);






}

void gt_lcd_drawpoint(int x, int y, U8 color)
{

	T_160_UC1698_lcd_DrawPoint(x,y,color);





}

void gt_lcd_clearall(U8 color)
{

	T_160_UC1698_lcd_ClearAll(color);





}

void gt_lcd_redraw(void)
{

	T_160_UC1698_lcd_Redraw();





}


void gt_lcd_setBR(char nBr)
{

	T_160_UC1698_lcd_SetBR(nBr);


}


void gt_lcd_setPM(U8 nPm)
{

	T_160_UC1698_lcd_SetPM(nPm);


}

void gt_lcd_getinfo(gt_lcd_info1 lcd_info)
{

		T_160_UC1698_lcd_info(lcd_info);





}




 






extern U8 r202x_Init(U8 nID,U8 ucType);
extern U8 r202x_GetTime(U8 nID, time_t *pTime);
extern U8 r202x_SetTime(U8 nID, time_t tTime,U8 ucType);

extern U8 isl1202x_Init(U8 nID);
extern U8 isl1202x_GetTime(U8 nID, time_t *pTime);
extern U8 isl1202x_SetTime(U8 nID, time_t tTime);



U8 gt_time_init(void)
{



	return r202x_Init(0,0);

}

U8 gt_get_time(time_t *pTime)
{



	return r202x_GetTime(0,pTime);

}


extern void gt_set_time_callback(time_t old,time_t now);
U8 gt_set_time(time_t tTime)
{


	gt_set_time_callback(time(0),tTime);




	return r202x_SetTime(0,tTime,0);



}

extern void httpOnSystemTimeSet(time_t old,time_t new);

void gt_set_time_callback(time_t old,time_t now)
{
	httpOnSystemTimeSet(old,now);
}




 
extern int vk321x_Open(U8 nChl,U32 xBaud,U8 xData,U8 xPari,U8 xStop,U32 bufsize);
extern int vk321x_Send(U8 nChl, const void *pData, U32 nLen);
extern int vk321x_Recv(U8 xUart,void* pBuf,int size,int nTmo,int ntry);
extern BOOL UART_OPEN(unsigned char xUart,unsigned int xBaud,unsigned char xData,unsigned char xPari,unsigned char xStop,unsigned short rxbufsize,unsigned short txbufsize);
extern BOOL UART_CLOSE(unsigned char xUart);
extern BOOL UART_SEND(unsigned char xUart, const void *pData, int nLen);
extern int UART_RECV(unsigned char xUart, void* pBuf,int size,int nTmo,int ntry);









int gt_uart_open(U8 xUart,U32 xBaud,U8 xData,U8 xPari,U8 xStop,U16 rxbufsize,U16 txbufsize)
{
	
	if(xUart < 5)
	{
		if(UART_OPEN(xUart, xBaud, xData, xPari, xStop, rxbufsize, txbufsize) == 1)
		{
			if(xUart == 0)			
			{
				gt_printf("gtDev_V1.2I     13-05-20      \n\r");	
			}
			return 1;
		}
		else
			return 0;
	}
	else if(xUart>=10||xUart<=13)	
	{

		switch(xUart)
		{
			case 10:
				return(vk321x_Open(0, xBaud, xData, xPari, xStop, rxbufsize));
			case 11:
				return(vk321x_Open(1, xBaud, xData, xPari, xStop, rxbufsize));
			case 12:
				return(vk321x_Open(2, xBaud, xData, xPari, xStop, rxbufsize));
			case 13:
				return(vk321x_Open(3, xBaud, xData, xPari, xStop, rxbufsize));
			default:
				return 0;
		}



	}
	else
		return 0;
}


int gt_uart_close(U8 xUart)
{
	if(xUart > 4)
		return 0;

	return(UART_CLOSE(xUart));
}




int gt_uart_send(U8 xUart, const void *pData, int nLen)
{
	
	if(xUart < 5)
	{
		return(UART_SEND(xUart, pData, nLen));
	}
	else if(xUart>=10||xUart<=13)	
	{

		switch(xUart)
		{
			case 10:
				return(vk321x_Send(0, pData, nLen));
			case 11:
				return(vk321x_Send(1, pData, nLen));
			case 12:
				return(vk321x_Send(2, pData, nLen));
			case 13:
				return(vk321x_Send(3, pData, nLen));
			default:
				return 0;
		}




	}
	else
		return 0;
}






int gt_uart_rev(U8 xUart, void* pBuf,int size,int nTmo,int ntry)
{
	
	if(xUart < 5)
	{
		return(UART_RECV(xUart, pBuf, size, nTmo, ntry));
	}
	else if(xUart>=10||xUart<=13)	
	{

		switch(xUart)
		{
			case 10:
				return (vk321x_Recv(0, pBuf, size, nTmo, ntry));
			case 11:
				return (vk321x_Recv(1, pBuf, size, nTmo, ntry));
			case 12:
				return (vk321x_Recv(2, pBuf, size, nTmo, ntry));
			case 13:
				return (vk321x_Recv(3, pBuf, size, nTmo, ntry));
			default:
				return 0;
		}



	}
	else
		return 0;
}



void gt_dev_init(void)
{
	int i;
	
	RCC_Config();

	
	NVIC_Config();

	

	GPIO_INIT();
	GPIO_CFGBUS();

	FSMC_Config(1,1,1,1,0);

	
	IWDG_Config();
	
	
	
	UART_INIT(0);
	UART_INIT(1);
	UART_INIT(2);
	UART_INIT(3);
	UART_INIT(4);
	gt_vk321x_init();
	

	gt_modem_init();

	gt_lcd_init();				
    gt_key_init();				
    gt_time_init();				
	gt_norf_init();				
 	gt_io_init();



	gt_spi_init(0);
	gt_spi_config(0, 32, 0, 1, 1);

	
	gt_ex_irq_config(5, 9, 0, 0);
	
	gt_pvd_open(0);			
}


























t_iomap pppMap[]=
{
	0,2,0x10,0,2,
	0,0,0x10,0,2,
	0,1,0x10,0,2,
	1,2,0x10,0,2,

};



#pragma arm section rwdata = "SRAM",zidata = "SRAM"
U16 eth_buf[1514/2];
#pragma arm section

#pragma arm section rwdata = "SRAM",zidata = "SRAM"

U64 ppp_buf[4096/8];
#pragma arm section


const U32 uneth_mtu = 1514;
const U32 unPPPbuf_size = 4096;

extern void Modem_Init(void);
void modem_init (void) 
{
	Modem_Init();
}








void *gt_malloc(unsigned int alloc_size)
{
	return malloc(alloc_size);
}


void gt_free(void *memory_ptr)
{
	free(memory_ptr);
}

void *gt_realloc(void *p, int size)
{
	return realloc(p, size);
}

#pragma arm section rwdata = "SRAM",zidata = "SRAM"

static char log_buf_ext[1024+2];
#pragma arm section 
void gt_printf_ext(const char *fmt, ...)
{
	va_list args;
	U32 length;

	__va_start(args, fmt);
	length = vsnprintf(log_buf_ext, 1024, fmt, args);
	__va_end(args);

	if(log_buf_ext[length-1]=='\n')
	{
	   log_buf_ext[length-1]= '\r';
	   log_buf_ext[length++]= '\n';
	}
	if(ucUART_DEBUG_ID != 200)
		gt_uart_send(ucUART_DEBUG_ID,log_buf_ext, length);
}




 

 

#line 728 "..\\config\\Retarget.c"
extern void* mem_malloc(int size);
extern int yaffs_open(const char *path, int oflag, int mode);
int yaffs_io_open (const char *name, const char *mmode)
{
	
	char * mode;
	if(!strcmp(mmode,"rb+"))
	{
		
		
		mode = "r+";

	}else mode = (char *)mmode;

	
	{
		char fullname[50];
		
		memset(fullname,0,sizeof(fullname));
		memcpy(fullname,"/flash/",8); 
		if(name[0] == '\/'){
			memcpy(&fullname[6],name,strlen(name));
		}else{
			memcpy(&fullname[7],name,strlen(name));
		}

		{
			int len = strlen(mode);
			int flag = 0;
			int ymode = 0666;
			int fd =0;
			int *pfd = 0;
			switch(mode[0]){
				case 'r':
					
					
					if(len>1&&mode[1]=='+'){
						
						flag |= 02|0100;
					}else{
						
						flag |= 00;
					}
					break;
				case 'w':
					flag |= 01|0100;
					
					break;
				case 'a':
					flag |= 02000;
					
					break;
				default:
					break;
			}

			
			fd = yaffs_open(fullname,flag,ymode);
			if(fd>=0){

				pfd = mem_malloc(sizeof(int));
				if(pfd){
					*((int*)pfd) = fd;
					return (int)pfd;
				}else{
					gt_printf("\n OPEN error,can't alloc memmory for fd");
					return 0;
				}
			}else return 0;
		}
		
	}
}

 

int yaffs_io_seek(int fp,int offset,int whence)
{
	int of = fs_io_seek(fp,offset,whence);   
	if(of == offset)return 0;                
	else return ~0;
}

 
extern int yaffs_close(int fd);
extern int mem_free(void*mem);
int yaffs_io_close(int fp)
{
	int handle = *((int*)fp);
	int rslt = yaffs_close(handle);
	if(rslt == 0){
		mem_free((void*)fp);
	}else{
		fp = fp;





	}
	return rslt;
}










 
#line 1 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdio.h"
 
 
 





 






 







 




  
 








#line 47 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdio.h"


  



    typedef unsigned int size_t;    









 
 

 



    typedef struct __va_list __va_list;






   




 




typedef struct __fpos_t_struct {
    unsigned __int64 __pos;
    



 
    struct {
        unsigned int __state1, __state2;
    } __mbstate;
} fpos_t;
   


 


   

 

typedef struct __FILE FILE;
   






 

#line 136 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdio.h"


extern FILE __stdin, __stdout, __stderr;
extern FILE *__aeabi_stdin, *__aeabi_stdout, *__aeabi_stderr;

#line 166 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdio.h"
    

    

    





     



   


 


   


 

   



 

   


 




   


 





    


 






extern __declspec(__nothrow) int remove(const char *  ) __attribute__((__nonnull__(1)));
   





 
extern __declspec(__nothrow) int rename(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   








 
extern __declspec(__nothrow) FILE *tmpfile(void);
   




 
extern __declspec(__nothrow) char *tmpnam(char *  );
   











 

extern __declspec(__nothrow) int fclose(FILE *  ) __attribute__((__nonnull__(1)));
   







 
extern __declspec(__nothrow) int fflush(FILE *  );
   







 
extern __declspec(__nothrow) FILE *fopen(const char * __restrict  ,
                           const char * __restrict  ) __attribute__((__nonnull__(1,2)));
   








































 
extern __declspec(__nothrow) FILE *freopen(const char * __restrict  ,
                    const char * __restrict  ,
                    FILE * __restrict  ) __attribute__((__nonnull__(2,3)));
   








 
extern __declspec(__nothrow) void setbuf(FILE * __restrict  ,
                    char * __restrict  ) __attribute__((__nonnull__(1)));
   




 
extern __declspec(__nothrow) int setvbuf(FILE * __restrict  ,
                   char * __restrict  ,
                   int  , size_t  ) __attribute__((__nonnull__(1)));
   















 
#pragma __printf_args
extern __declspec(__nothrow) int fprintf(FILE * __restrict  ,
                    const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   


















 
#pragma __printf_args
extern __declspec(__nothrow) int _fprintf(FILE * __restrict  ,
                     const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   



 
#pragma __printf_args
extern __declspec(__nothrow) int printf(const char * __restrict  , ...) __attribute__((__nonnull__(1)));
   




 
#pragma __printf_args
extern __declspec(__nothrow) int _printf(const char * __restrict  , ...) __attribute__((__nonnull__(1)));
   



 
#pragma __printf_args
extern __declspec(__nothrow) int sprintf(char * __restrict  , const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   






 
#pragma __printf_args
extern __declspec(__nothrow) int _sprintf(char * __restrict  , const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   



 

#pragma __printf_args
extern __declspec(__nothrow) int snprintf(char * __restrict  , size_t  ,
                     const char * __restrict  , ...) __attribute__((__nonnull__(3)));
   















 

#pragma __printf_args
extern __declspec(__nothrow) int _snprintf(char * __restrict  , size_t  ,
                      const char * __restrict  , ...) __attribute__((__nonnull__(3)));
   



 
#pragma __scanf_args
extern __declspec(__nothrow) int fscanf(FILE * __restrict  ,
                    const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   






























 
#pragma __scanf_args
extern __declspec(__nothrow) int _fscanf(FILE * __restrict  ,
                     const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   



 
#pragma __scanf_args
extern __declspec(__nothrow) int scanf(const char * __restrict  , ...) __attribute__((__nonnull__(1)));
   






 
#pragma __scanf_args
extern __declspec(__nothrow) int _scanf(const char * __restrict  , ...) __attribute__((__nonnull__(1)));
   



 
#pragma __scanf_args
extern __declspec(__nothrow) int sscanf(const char * __restrict  ,
                    const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   








 
#pragma __scanf_args
extern __declspec(__nothrow) int _sscanf(const char * __restrict  ,
                     const char * __restrict  , ...) __attribute__((__nonnull__(1,2)));
   



 

 
extern __declspec(__nothrow) int vfscanf(FILE * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) int vscanf(const char * __restrict  , __va_list) __attribute__((__nonnull__(1)));
extern __declspec(__nothrow) int vsscanf(const char * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2)));

extern __declspec(__nothrow) int _vfscanf(FILE * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) int _vscanf(const char * __restrict  , __va_list) __attribute__((__nonnull__(1)));
extern __declspec(__nothrow) int _vsscanf(const char * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2)));

extern __declspec(__nothrow) int vprintf(const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1)));
   





 
extern __declspec(__nothrow) int _vprintf(const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1)));
   



 
extern __declspec(__nothrow) int vfprintf(FILE * __restrict  ,
                    const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2)));
   






 
extern __declspec(__nothrow) int vsprintf(char * __restrict  ,
                     const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2)));
   






 

extern __declspec(__nothrow) int vsnprintf(char * __restrict  , size_t  ,
                     const char * __restrict  , __va_list  ) __attribute__((__nonnull__(3)));
   







 

extern __declspec(__nothrow) int _vsprintf(char * __restrict  ,
                      const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2)));
   



 
extern __declspec(__nothrow) int _vfprintf(FILE * __restrict  ,
                     const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2)));
   



 
extern __declspec(__nothrow) int _vsnprintf(char * __restrict  , size_t  ,
                      const char * __restrict  , __va_list  ) __attribute__((__nonnull__(3)));
   



 
extern __declspec(__nothrow) int fgetc(FILE *  ) __attribute__((__nonnull__(1)));
   







 
extern __declspec(__nothrow) char *fgets(char * __restrict  , int  ,
                    FILE * __restrict  ) __attribute__((__nonnull__(1,3)));
   










 
extern __declspec(__nothrow) int fputc(int  , FILE *  ) __attribute__((__nonnull__(2)));
   







 
extern __declspec(__nothrow) int fputs(const char * __restrict  , FILE * __restrict  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) int getc(FILE *  ) __attribute__((__nonnull__(1)));
   







 




    extern __declspec(__nothrow) int (getchar)(void);

   





 
extern __declspec(__nothrow) char *gets(char *  ) __attribute__((__nonnull__(1)));
   









 
extern __declspec(__nothrow) int putc(int  , FILE *  ) __attribute__((__nonnull__(2)));
   





 




    extern __declspec(__nothrow) int (putchar)(int  );

   



 
extern __declspec(__nothrow) int puts(const char *  ) __attribute__((__nonnull__(1)));
   





 
extern __declspec(__nothrow) int ungetc(int  , FILE *  ) __attribute__((__nonnull__(2)));
   






















 

extern __declspec(__nothrow) size_t fread(void * __restrict  ,
                    size_t  , size_t  , FILE * __restrict  ) __attribute__((__nonnull__(1,4)));
   











 

extern __declspec(__nothrow) size_t __fread_bytes_avail(void * __restrict  ,
                    size_t  , FILE * __restrict  ) __attribute__((__nonnull__(1,3)));
   











 

extern __declspec(__nothrow) size_t fwrite(const void * __restrict  ,
                    size_t  , size_t  , FILE * __restrict  ) __attribute__((__nonnull__(1,4)));
   







 

extern __declspec(__nothrow) int fgetpos(FILE * __restrict  , fpos_t * __restrict  ) __attribute__((__nonnull__(1,2)));
   








 
extern __declspec(__nothrow) int fseek(FILE *  , long int  , int  ) __attribute__((__nonnull__(1)));
   














 
extern __declspec(__nothrow) int fsetpos(FILE * __restrict  , const fpos_t * __restrict  ) __attribute__((__nonnull__(1,2)));
   










 
extern __declspec(__nothrow) long int ftell(FILE *  ) __attribute__((__nonnull__(1)));
   











 
extern __declspec(__nothrow) void rewind(FILE *  ) __attribute__((__nonnull__(1)));
   





 

extern __declspec(__nothrow) void clearerr(FILE *  ) __attribute__((__nonnull__(1)));
   




 

extern __declspec(__nothrow) int feof(FILE *  ) __attribute__((__nonnull__(1)));
   


 
extern __declspec(__nothrow) int ferror(FILE *  ) __attribute__((__nonnull__(1)));
   


 
extern __declspec(__nothrow) void perror(const char *  );
   









 

extern __declspec(__nothrow) int _fisatty(FILE *   ) __attribute__((__nonnull__(1)));
    
 

extern __declspec(__nothrow) void __use_no_semihosting_swi(void);
extern __declspec(__nothrow) void __use_no_semihosting(void);
    





 











#line 985 "d:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdio.h"



 

#line 1079 "..\\config\\Retarget.c"

#pragma import(__use_no_semihosting_swi)

struct __FILE { int handle;      };
FILE __stdout,__stderr;





 
int GetKey(int* cmd)
{
	if(USART_GetFlagStatus(((USART_TypeDef *) ((((u32)0x40000000) + 0x10000) + 0x3800)), ((u16)0x0020)) == RESET) 
		return 0;
	*cmd = USART_ReceiveData(((USART_TypeDef *) ((((u32)0x40000000) + 0x10000) + 0x3800)));	
	return 1;
}


 
int SendChar(int ch)
{

	while ((((USART_TypeDef *) ((((u32)0x40000000) + 0x10000) + 0x3800))->SR & ((u16)0x0080)) == 0);
	((USART_TypeDef *) ((((u32)0x40000000) + 0x10000) + 0x3800))->DR = ch & 0x1FF;
	return ch;
}

 

int fputc(int ch, FILE *f)
{

	return (SendChar(ch));
}


 

int fgetc(FILE *f)
{
	int key;
	GetKey(&key);
	if(key)	return (SendChar(key));
	else return 0;
}

 

int ferror(FILE *f)
{

	 
	return (-1);
}


 

void _ttywrch (int ch)
{




}


 

void _sys_exit (int return_code)
{

	 
	while (1);
}




 

#line 1328 "..\\config\\Retarget.c"


 



 

#line 3986 "..\\config\\Drv_Config_NWJ.c"

